当前位置:网站首页>Summernote font displays Chinese
Summernote font displays Chinese
2022-07-24 02:46:00 【Summer is already slightly cool】
@toc
One 、 step
- 1、 introduce
summernote-zh-CN.js:
<script src="/summernote/lang/summernote-zh-CN.js"></script>
- 2、 Set language properties when calling
$('#summernote').summernote({
lang:'zh-CN'
});
Two 、 Code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>summernote Font display Chinese </title>
<!-- Reference Online bootstrap.css -->
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"/>
<!-- Reference Online summernote.css -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/summernote.css" rel="stylesheet">
</head>
<body>
<div id="vue-mount-element" style="padding: 20px">
<textarea name="content" id="editor">{
{info.content}}</textarea>
</div>
</body>
<!-- Reference Online jquery.js -->
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
<!-- Abreast of the times Bootstrap The core JavaScript file -->
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<!-- summernote The core JavaScript file -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/summernote.js"></script>
<!-- summernote chinese js file -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/lang/summernote-zh-CN.js"></script>
<!-- Reference Online vue.js -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
<script> let vueObject = new Vue({
el: '#vue-mount-element', //vue Mounted elements data() {
return {
info: {
id: 1, content: "<b> Bold content </b>, Normal content "} }; } }) $(document).ready(function () {
$('#editor').summernote({
// Rich text mounted elements id=editor lang:'zh-CN', // height: 500, // width: 1000, minHeight: 300, // Wide and high , Set up according to your own needs : If it is displayed on the mobile phone , Just make the width smaller , such as 410px maxwidth: 1000, minwidth: 200, maxHeight: 500, focus: false, callbacks: {
onImageUpload: function (files, editor) {
var $files = $(files); // adopt each Method to iterate through each file $files.each(function () {
var file = this; // FormData, new form Form encapsulation , Baidu , But in fact, the usage is very simple , as follows var data = new FormData(); // Add files to file in , The back end can get the parameter named “file” data.append("file", file); // ajax Upload $.ajax({
data: data, type: "POST", url: "/upload/image",// div Upper action cache: false, contentType: false, processData: false, // Call the method when successful , Backend return json data success: function (response) {
// console.log(response) if (response.error != 0) {
alert(" Upload failed :" + response.message); } else {
// Insert into summernote $('#editor').summernote('insertImage', response.url); } }, }); }) }, onFileUpload: function (files) {
// Upload files , There is no default , How to add , Please read the next one var $files = $(files); // adopt each Method to iterate through each file $files.each(function () {
var file = this; // FormData, new form Form encapsulation , Baidu , But in fact, the usage is very simple , as follows var data = new FormData(); // Add files to file in , The back end can get the parameter named “file” data.append("file", file); // ajax Upload $.ajax({
data: data, type: "POST", url: "/upload/file",// div Upper action cache: false, contentType: false, processData: false, // Call the method when successful , Backend return json data success: function (response) {
// console.log(response) if (response.error != 0) {
alert(" Upload failed :" + response.message); } else {
$(".note-video-url").val(response.url); //Insert Video Before, input online video url Remove disable after address , Now we upload it to Video URL Disable is removed after the input box is assigned $(".note-video-btn").removeAttr("disabled"); } }, }); }) } } }); }) </script>
</html>
边栏推荐
- Réalisation d'un diagramme de zone de ligne brisée - Diagramme Rose - Diagramme à barres
- SkyWalking分布式系统应用程序性能监控工具-上
- Live800: there is nothing trivial about customer service. Don't let service destroy the reputation of the enterprise
- TP5 framework link promotion project
- 微信小程序實現折線面積圖-玫瑰圖-立體柱狀圖
- Wechat applet setting background image does not display problem solution
- Essential skills for programmers -- breakpoint debugging (idea version)
- 【补题日记】[2022牛客暑期多校1]D-Mocha and Railgun
- Tutoriel sur l'utilisation de la ligne de temps unitaire
- js传参时传入 string有数据;传入 number时没有数据;2[0]是对的!number类型数据可以取下标
猜你喜欢

Composition API (in setup) watch usage details
![[diary of supplementary questions] [2022 Niuke summer school 1] i-chiitoitsu](/img/be/47b8a86399f760e7cd6181528884c6.png)
[diary of supplementary questions] [2022 Niuke summer school 1] i-chiitoitsu

攻防世界WEB练习区(weak_auth、simple_php、xff_referer)

SSM family financial management personal financial management system accounting system

"Why should we do IVX?"—— Interview with IVX CEO Meng Zhiping to understand IVX corporate culture

Share an API Gateway project based on ABP and yarp

UIE: 信息抽取的大一统模型

Attack and defense world web practice area (view_source, get_post, robots)

Nodejs builds cloud native microservice applications based on dapr, a quick start guide from 0 to 1

Attack and defense world web practice area (weak_auth, simple_php, xff_referer)
随机推荐
Nodejs builds cloud native microservice applications based on dapr, a quick start guide from 0 to 1
Numberoptional: a tool for converting strings to numbers
Analyze the overall planning of steam and maker education classroom
C language exercises
compostion-api(setup中) watch使用细节
【补题日记】[2022牛客暑期多校1]D-Mocha and Railgun
Tutoriel sur l'utilisation de la ligne de temps unitaire
Camper recruitment | AI youth with the world in mind, the United Nations needs your help for sustainable development!
Diversity of SIGIR '22 recommendation system papers
云原生讲解【扩展篇】
微信小程序實現折線面積圖-玫瑰圖-立體柱狀圖
rust allow dead_ code
【补题日记】[2022牛客暑期多校1]I-Chiitoitsu
Mysql database, query
go strconv
Share an API Gateway project based on ABP and yarp
22 -- 二叉搜索树的范围和
Honey, we are homeless now
相关性(correlation)
[brother hero July training] day 23: dictionary tree