如何在单独的文件中编写 Vue js 代码并包含在 laravel 中



如何在单独的文件中编写 Vue js 代码并包含在 laravel 中 刀片页面代码?

我也使用gulp文件。

@section('js')
<script>
new Vue({
// Defining a element.
el: '#branddashboard-html',
data: {
// Defining data variable.
brandStats: null
},
// On load functionality.
created: function () {
// Initializing method.
this.getData();
},

},
// Methods to implement.
methods: {
getData: function () {
self.brandStats = null;
$.get('brand-stats/' + userId + '/' + period, function (data) {
self.brandStats = data;
});
}
}
});
</script>
@endsection

我认为这不是最好的主意。我认为,刀片的模板仅适用于视图文件夹。你的前端逻辑现在由 Vue 组件系统管理,以这种 MVVM vue 的方式。希望这对你有用

最新更新