diff --git a/nuxt.config.js b/nuxt.config.js index 95910cb..190c948 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -24,6 +24,7 @@ module.exports = { { src: '~/plugins/element-ui', ssr: false }, { src: '~/plugins/vue-gtag.js', ssr: false, mode: 'client' }, { src: '~/plugins/vue-sanitize', ssr: false }, + { src: '~/plugins/directives', ssr: false }, ], // Auto import components: https://go.nuxtjs.dev/config-components diff --git a/plugins/directives.js b/plugins/directives.js new file mode 100644 index 0000000..8b2857d --- /dev/null +++ b/plugins/directives.js @@ -0,0 +1,7 @@ +import Vue from 'vue' + +Vue.directive('fcf', { + inserted(el) { + el.innerHTML = el.innerHTML.replace(/(\d+)/g, `$1`) + }, +})