grapesjs文本添加超链接如何改成下拉选择?
默认是文本输入框,太繁琐了。
网友回复
这样
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/grapes.0.21.1.css"> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/grapes.0.21.1.js"></script> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/grapesjs-preset-webpage.1.0.2.js"></script> <style> body, html { height: 100%; margin: 0; } #gjs { border: 3px solid #444; } </style> </head> <body> <div id="gjs" style="height:100%;"></div> <script> document.addEventListener('DOMContentLoaded', function () { const editor = grapesjs.init({ container: '#gjs', fromElement: true, height: '100%', width: 'auto', plugins: ['gjs-preset-webpage'], pluginsOpts: { 'gjs-preset-webpage': {} } }); // Initial content editor.setComponents(` <div> <p id="selectable-link">Click here to select a link<...
点击查看剩余70%