vue-remove-whitespace
Version:
A set of reusable remove whitespace directives for reusable Vue.js components
60 lines (41 loc) • 1.37 kB
Markdown
> A reusable remove whitespace directive for reusable [Vue.js](https://github.com/vuejs/vue) components
英語では通常、単語は空白文字で区切られます。一方、中国語、日本語、タイ語などの言語では通常、単語間の区切り文字は一切使用されません。
spanやa、またそれらを内包したVue コンポーネントなどのinline要素内での改行は、意図しないWhitespaceを作ってしまいます。
`vue-remove-whitespace` はそれらの課題を解決します。
- vue: ^2.0.0
``` js
import { removeWhitespace } from 'vue-remove-whitespace';
export default {
directives: { removeWhitespace: removeWhitespace },
template: `
<p v-remove-whitespace>
お問い合わせは
<a href="#">こちらから</a>
お願いします
</p>
`,
};
```
``` js
import { mixin as removeWhitespaceMixin } from 'vue-remove-whitespace';
export default {
mixins: [ removeWhitespaceMixin ],
template: `
<p v-remove-whitespace>
お問い合わせは
<a href="#">こちらから</a>
お願いします
</p>
`,
};
```
forked configuration [vue-focus](https://www.npmjs.com/package/vue-focus)
[](https://opensource.org/licenses/MIT)