yii2-vue

Github星跟踪图

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(); ?>

主要指标

概览
名称与所有者akbarjoudi/yii2-vue
主编程语言PHP
编程语言PHP (语言数: 2)
平台
许可证
所有者活动
创建于2017-02-17 21:07:40
推送于2021-09-18 22:38:07
最后一次提交2021-09-18 22:38:07
发布数13
最新版本名称0.6.9 (发布于 )
第一版名称0.5 (发布于 )
用户参与
星数69
关注者数7
派生数21
提交数58
已启用问题?
问题数4
打开的问题数1
拉请求数3
打开的拉请求数1
关闭的拉请求数1
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?