2
0
mirror of https://github.com/tenrok/BBob.git synced 2026-06-20 20:00:33 +03:00
Files
bbob/packages/bbob-preset-vue/src/index.js
T
Nikolay Kostyurin cbccbaf896 feat: support for vue2 (#88)
* chore: initial setup for vue2 packages

* feat: basic Vue 2 Component

* feat(vue2): add more test cases

* test(preset): add more cases to test in preset

* test(preset-vue2): add more cases to test tags processing

* fix(preset): tag node checking

* test(preset-vue): more coverage for vue preset

* refactor(vue2): move default export to plugin install func

* feat(example-vue2): add vue2 example to examples folder

* chore(example-vue2): remove unused npm scripts

* chore: add vue 2 example in main README

* chore: update package.json descriptions
2021-05-19 19:41:56 +02:00

35 lines
635 B
JavaScript

import presetHTML5 from '@bbob/preset-html5';
export const tagAttr = (style) => ({
attrs: {
style,
},
});
export const createTags = (tags) => ({
b: (...args) => ({
...tags.b(...args),
...tagAttr({ fontWeight: 'bold' }),
}),
i: (...args) => ({
...tags.i(...args),
...tagAttr({ fontStyle: 'italic' }),
}),
u: (...args) => ({
...tags.u(...args),
...tagAttr({ textDecoration: 'underline' }),
}),
s: (...args) => ({
...tags.s(...args),
...tagAttr({ textDecoration: 'line-through' }),
}),
});
export default presetHTML5.extend((tags) => ({
...tags,
...createTags(tags),
}));