Javascript 使用vue.js和laravel查看

Javascript 使用vue.js和laravel查看,javascript,vue.js,laravel-5.2,Javascript,Vue.js,Laravel 5.2,嗨,我试图显示一些数据,但我弄错了 如果我把所有的东西都放在同一个文件中,比如overview.js den,就可以了。 结果应该是带有一些数据的3个框 这是我的blade.php: @extends('index') @section('container') <template> <div class="row" id="app"> <div class="col-lg-3 col-sm-6" v-for="stats in st

嗨,我试图显示一些数据,但我弄错了 如果我把所有的东西都放在同一个文件中,比如overview.js den,就可以了。 结果应该是带有一些数据的3个框

这是我的blade.php:

@extends('index')
@section('container')
    <template>
    <div class="row" id="app">
        <div class="col-lg-3 col-sm-6" v-for="stats in statsCards">
            <stats-card>
                <div class="icon-big text-center" :class="`icon-${stats.type}`" slot="header">
                    <i :class="stats.icon"></i>
                </div>
                <div class="numbers" slot="content">
                    <p>{{stats.title}}</p>
                    {{stats.value}}
                </div>
                <div class="stats" slot="footer">
                    <i :class="stats.footerIcon"></i> {{stats.footerText}}
                </div>
            </stats-card>
        </div>
    </div>
        </template>
    <script src="resources/assets/js/app.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.18/vue.min.js"></script>
@endsection 
我收到此错误使用未定义的常量统计信息-假定的“统计信息” 我不知道我做错了什么有什么想法吗?
感谢您的帮助。

Blade尝试以php的形式执行
{{}
的内容。您需要转义:
@{}

您转义了所有这些吗?此外,您正在引入一个旧版本的Vue。
import StatsCard from 'js/components/UIComponents/Cards/StatsCard.vue'
new Vue({

    el: '#app',

    export default {
        components: {
            StatsCard

        },

    data() return {

        statsCards: [
            {
                type: 'warning',
                icon: 'ti-server',
                title: 'Capacity',
                value: '105GB',
                footerText: 'Updated now',
                footerIcon: 'ti-reload'
            },
            {
                type: 'success',
                icon: 'ti-wallet',
                title: 'Revenue',
                value: '$1,345',
                footerText: 'Last day',
                footerIcon: 'ti-calendar'
            },
            {
                type: 'danger',
                icon: 'ti-pulse',
                title: 'Errors',
                value: '23',
                footerText: 'In the last hour',
                footerIcon: 'ti-timer'
            },
            {
                type: 'info',
                icon: 'ti-twitter-alt',
                title: 'Followers',
                value: '+45',
                footerText: 'Updated now',
                footerIcon: 'ti-reload'
            }
        ]

    }
}

})