mirror of
https://github.com/tenrok/BBob.git
synced 2026-06-20 20:00:33 +03:00
cbccbaf896
* 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
35 lines
635 B
JavaScript
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),
|
|
}));
|