R
R
Ruslan Absalyamov2018-11-24 11:29:37
Vue.js
Ruslan Absalyamov, 2018-11-24 11:29:37

How to get rid of rendering problem?

I get an error

You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build

I am using vue-cli. As I understand it, he swears at this code
let tabs = [
        {
            name: "spending",
            label: "Расходы",
            component: {
                template: `<div>
                    <div>{{ account.spending.month }} за месяц</div>
                    <div>{{ account.spending.weekend }} за неделю</div>
                    <div>{{ account.spending.today }} за день</div>
                    </div>`
            }
        },
        {
            name: "income",
            label: "Доходы",
            component: {
                template: `
                <div>
                    <div>{{ account.income.month }} за месяц</div>
                    <div>{{ account.income.weekend }} за неделю</div>
                    <div>{{ account.income.today }} за день</div>
                </div>`
            }
        }
    ];

How can I get rid of this error? If you take the sandbox
, then there is no this error, but simply the data is not displayed

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
coderisimo, 2018-11-24
@rusline18

You are told that you are using a build where the template compiler is not available. Either pre-compile functions to render, or use a build with a compiler.
By default runtimeCompiler is set to false . Try enabling it in the config (vue.config.js).

module.exports = {
  runtimeCompiler: true
}

https://cli.vuejs.org/config/#runtimecompiler

D
Decadal, 2018-11-24
@Decadal

Everything is written there. The Vue repository has a list of versions. You need Full and not runtime-only.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question