我有一个问题,
如何在Symfony2 Twig中获得用户角色.
我曾四处寻找,但我找不到它.
请帮忙,或线索..
谢谢你.
叶诚万
由于货币过滤器在vue2中已弃用,我需要导入/使用外部库accounting.js但是我在组件中使用accounting.js时遇到问题.
控制台显示如下错误:
[Vue警告]:属性或方法"accounting"未在实例上定义,但在呈现期间引用.确保在数据选项中声明反应数据属性.(在C:\ project\resources\assets\js\components\ItemProductView.vue中的组件中找到)
这是我的app.js
require('./bootstrap');
var accounting = require('./accounting');
module.exports = accounting;
import BannerView from './components/BannerView.vue';
import CategoryView from './components/CategoryView.vue';
import TopProductView from './components/TopProductView.vue';
const app = new Vue({
el: '#app',
data:{
message: 'hello'
},
components:{
BannerView, CategoryView, TopProductView
},
});
Run Code Online (Sandbox Code Playgroud)
和TopProductView.vue文件:
<template>
<div class="row">
<div class="col-sm-6 col-md-3" v-for="item in list">
{{accounting.formatNumber(item.price)}}
<item-product-view :item="item"></item-product-view>
</div>
</div>
</template>
<script>
import ItemProductView from './ItemProductView.vue';
export default {
mounted() {
this.fetchList();
},
components:{
ItemProductView
},
data() {
return { …
Run Code Online (Sandbox Code Playgroud)