快速开始
安装
shell
# npm
npm -i @yiitap/vue
# yarn
yarn add @yiitap/vue
# pnpm
pnpm add @yiitap/vue
使用
安装后,在你的App中使用 YiiEditor。
vue
<template>
<YiiEditor ref="yiiEditor" v-bind="options" @update="onUpdate" />
</template>
<script setup lang="ts">
import { computed, ref } from 'vue';
import { YiiEditor } from '@yiitap/vue';
import '@yiitap/vue/dist/vue.css';
const yiiEditor = ref<InstanceType<typeof YiiEditor>>();
const options = computed(() => {
return {
content: '',
showMainMenu: false,
showBubbleMenu: true,
showSideMenu: true,
pageView: 'page',
}
})
function onUpdate({ json, html }: { json: any; html: string }) {
console.log('update', json)
console.log('update', html);
}
</script>
完整的示例请参考: Demo
更多
若想了解更多信息,可查看相关文档: