How To Change Vue-cli's Delimiters?
I installed vue-cli (webpack-simple) src/main.js: import Vue from 'vue' import App from './App.vue' new Vue({ delimiters: ['?{', '}'], // here , delimiters set ' ?{ } ' e
Solution 1:
See the response from the Author:
Delimiters can only be changed when using runtime compilation with the full build (vue.js). It does not work in *.vue files (to keep all *.vue files syntax consistent)
Vue 2.5.1 Component custom delimiter not working #5697
[2020/07/03]
How to config to use runtime compiler to use custom delimiters
Create a
vue.config.js
file at your project root(the place you storepackage.json
)Add the content as follow:
// vue.config.jsmodule.exports = {
runtimeCompiler: true
}
- Delete
<template />
atapp.vue
- Modify the
<script />
atapp.vue
as follow:
// app.vue
<script>exportdefault {
delimiters: ['{', '}'],
name: 'App',
template: '<div id="app">{ title }</div>',
data () {
return {
title: 'This is a Title'
};
}
};
</script>
- The document Configuration Reference#runtimeCompiler
Post a Comment for "How To Change Vue-cli's Delimiters?"