首页 > 代码库 > yii2_vue_表单案例
yii2_vue_表单案例
<?php /** * Created by PhpStorm. * User: Administrator * Date: 2017/2/5 * Time: 17:36 */ use yii\helpers\Url; use \common\models\AdminSite; use \common\utils\Cache; use \common\services\TudouService; $adminsite=Cache::GAutoRoute(‘adminsite‘,TudouService::class,‘getAdminSite‘,60); $keywords=Cache::GAutoRoute(‘keywords‘,TudouService::class,‘getKeywords‘,0,60); $channel=Cache::GAutoRoute(‘channel‘,TudouService::class,‘getChannel‘,0,60);
//$channel代表AR
?> <div class="container"> <form id="demo" method="post" class="form " action="<?=Url::toRoute(‘admin-npsearch/test‘)?>"> <div class="row"> <div class="col-md-4"> <label class="span6">分类ID-:</label> <select class="form-group span6" name="FTypeID" v-model="FTypeID"> <option v-for="(item,key) in admin_channel.options" :value="http://www.mamicode.com/item.fid">{{item.name}}</option> </select> {{FTypeID}} </div> </div> <input class="btn btn-success btn-block" type="submit"> </form> </div> <script> new Vue({ el: ‘#demo‘, data: { keyword: ‘‘, FTypeID: ‘1‘, FSiteID: ‘1‘, FKeywordID:‘1‘, site: { options:<?=$adminsite?> }, keywords: { options:<?=$keywords?> }, admin_channel: { options:<?=$channel?> }, } }); </script>
yii2_vue_表单案例
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。