yii2-vue

  • 所有者: akbarjoudi/yii2-vue
  • 平台:
  • 許可證:
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

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 13:07:40
推送於2021-09-18 14:38:07
最后一次提交2021-09-18 19:08:07
發布數13
最新版本名稱0.6.9 (發布於 )
第一版名稱0.5 (發布於 )
用户参与
星數69
關注者數7
派生數21
提交數58
已啟用問題?
問題數4
打開的問題數1
拉請求數3
打開的拉請求數1
關閉的拉請求數1
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?