uniapp 使用 tob-ui 实现文章编辑器 - 无需填写作者,默认显示“佚名”
<p>"<view class="form">\n <view class="form-item">\n <text class="form-item-label">标题</text>\n <t-input v-model="form.title" placeholder="请输入标题" rounded="base" />\n </view>\n <view class="form-item">\n <text class="form-item-label">内容</text>\n <Rboy-editor ref="RboyEditor">\n </Rboy-editor>\n </view>\n <view class="form-item">\n <text class="form-item-label">作者</text>\n <text>{{ returnform.author }}</text>\n </view>\n <view class="form-item button-container">\n <t-btn color="warning" @click="resetForm" size="lg" class="button">重置</t-btn>\n <t-btn color="success" @click="submitForm" size="lg" class="button">上传提交</t-btn>\n </view>\n</view>\n\n<script>\n export default {\n data() {\n return {\n form: {\n title: "",\n author: ""\n },\n returnform: {\n author: "佚名"\n }\n };\n },\n methods: {\n resetForm() {\n this.form.title = "" ;\n this.form.author = "" ;\n this.$refs.RboyEditor.resetEditor();\n },\n submitForm() {\n // Submit form logic\n }\n }\n };\n</script>\n</p>
原文地址: https://www.cveoy.top/t/topic/qwxg 著作权归作者所有。请勿转载和采集!