yii2-vue

  • Owner: akbarjoudi/yii2-vue
  • Platform:
  • License::
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

vuejs

for yii2 web application

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require aki/yii2-vue "*"

or add

"aki/yii2-vue": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

<?php
use aki\vue\Vue;
?>
<?php Vue::begin([
    'id' => "vue-app",
    'data' => [
        'userModel' => User::findOne(Yii::$app->user->id),
        'message' => "hello",
        'seen' => false,
        'todos' => [
            ['text' => "aa"],
            ['text' => "akbar"]
        ]
    ],
    'methods' => [
        'reverseMessage' => new yii\web\JsExpression("function(){"
                . "this.message =1; "
                . "}"),
    ]
]); ?>
    
    <p>{{ message }}</p>
    <button v-on:click="reverseMessage">Reverse Message</button>
    
    <p v-if="seen">Now you see me</p>
    
    
    <ol>
        <li v-for="todo in todos">
          {{ todo.text }}
        </li>
    </ol>
    
    <p>{{ message }}</p>
    <input v-model="message">
  
  
<?php Vue::end(); ?>

Main metrics

Overview
Name With Ownerakbarjoudi/yii2-vue
Primary LanguagePHP
Program languagePHP (Language Count: 2)
Platform
License:
所有者活动
Created At2017-02-17 13:07:40
Pushed At2021-09-18 14:38:07
Last Commit At2021-09-18 19:08:07
Release Count13
Last Release Name0.6.9 (Posted on )
First Release Name0.5 (Posted on )
用户参与
Stargazers Count69
Watchers Count7
Fork Count21
Commits Count58
Has Issues Enabled
Issues Count4
Issue Open Count1
Pull Requests Count3
Pull Requests Open Count1
Pull Requests Close Count1
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private