当前位置:网站首页>uniapp用uParse实现解析后台的富文本编辑器的内容及修改uParse样式
uniapp用uParse实现解析后台的富文本编辑器的内容及修改uParse样式
2022-06-26 08:35:00 【@Winner】
阐述
在使用uniapp开发的时候,避免不了一些新闻类的内容,需要后台使用 百度的 UEditor 进行上传一些图文混排的内容。
下载插件
首先,到DCLOUD插件市场将uParse这个插件通过HBuilder X下载到你的项目中(插件链接:https://ext.dcloud.net.cn/plugin?id=183。
基本使用
- 具体详细的时候方法可以参考插件文档,这边不在详细描述了。
<template>
<div>
<u-parse :content="article" @preview="preview" @navigate="navigate" ></u-parse>
</div>
</template>
<script> import uParse from '@/components/u-parse/u-parse.vue' export default {
components: {
uParse }, data () {
return {
article: '<div>我是HTML代码</div>' } }, methods: {
preview(src, e) {
// do something }, navigate(href, e) {
// do something } } } </script>
<style> @import url("@/components/u-parse/u-parse.css"); </style>
修改uParse原样式
- 如果要修改样式的话要用/deep/进行强制修改。
- uniapp使用的时候一般都在App.vue里面修改。
App.vue
<style scoped> @import url("/components/u-parse/u-parse.css"); /deep/ .wxParse{
margin: 10px auto; width: 90vw; padding: 20px 10px; } /deep/ .first{
text-align: center; padding-bottom: 5px; border-bottom: 1px solid #CDCDCD; } </style>
边栏推荐
- ZLMediaKit推流拉流测试
- ROS learning notes (5) -- Exploration of customized messages
- [resolved]setonnavigationitemselectedlistener() deprecated
- Google Chrome collection
- Intra class data member initialization of static const and static constexpr
- Recovering the system with Clonezilla USB disk
- 【云原生 | Kubernetes篇】深入万物基础-容器(五)
- Jupyter的安装
- Text to SQL model ----irnet
- 在同花顺开户证券安全吗,
猜你喜欢

Matlab drawing checkerboard (camera calibration)

框架跳转导致定位失败的解决方法

鲸会务为活动现场提供数字化升级方案

Opencv learning notes II

Remote centralized control of distributed sensor signals using wireless technology

Polka lines code recurrence

利用无线技术实现分散传感器信号远程集中控制

Exploration of webots and ROS joint simulation (I): software installation

Opencv learning notes 3

Transformers loading Roberta to implement sequence annotation task
随机推荐
Nebula diagram_ Object detection and measurement_ nanyangjx
Stanford doggo source code study
Whale conference provides digital upgrade scheme for the event site
1.25 suggestions and design of machine learning
1.17 daily improvement of winter vacation learning (frequency school and Bayesian school) and maximum likelihood estimation
Convert verification code image to tfrecord file
编程训练7-日期转换问题
VS2005 project call free() compiled with static libcurl library reported heap error
Backward usage
SQL learning experience (II): question brushing record
opencv学习笔记二
Leetcode: array fast and slow pointer method
关于极客时间 | MySQL实战45讲的部分总结
MPC learning notes (I): push MPC formula manually
Deploy wiki system Wiki in kubesphere JS and enable Chinese full-text retrieval
WBC learning notes (II): practical application of WBC control
Convex optimization of quadruped
三菱PLC若想实现以太网无线通讯,需要具备哪些条件?
Drawing with MATLAB (2) -- color ring
Simulation of parallel structure using webots