Vue.etiquetas js change {}}
Quiero cambiar el {{ something }}
por <% something %>
en Vue.js, ¿cómo podría lograrlo? ¿Es posible?
Un equivalente para lo que busco en AngularJS:
var app = angular.module('app', [], function($interpolateProvider) {
$interpolateProvider.startSymbol('<%');
$interpolateProvider.endSymbol('%>');
});
Muchas Gracias por su ayuda!
25
3 answers
Debe modificar la delimiters
propiedad del objeto de configuración.
Vue.config.delimiters = ['<%', '%>']
Editar: Esta solución funciona para Vue 1.x e inferior. Ver @Skip y @jaynabonne respuestas para Vue 2.x solución
18
Author: Pantelis Peslis,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-01-19 14:56:03
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-01-19 14:56:03
Con la última versión (2.0.5), lo anterior no funciona. En lugar de asignar a la configuración global, pasa los delimitadores como una opción a la instancia de Vue:
new Vue({
el: '#app',
data: data,
delimiters: ["<%","%>"]
});
Al menos, eso es lo que tenía que hacer para que funcionara.
55
Author: jaynabonne,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-11-10 22:33:04
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-11-10 22:33:04
Estoy ejecutando Vue 2.1.0 standalone y esto es lo que tenía que usar
Vue.options.delimiters = ['{[{', '}]}'];
20
Author: Skip,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-03-03 22:09:54
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-03-03 22:09:54