Giter VIP home page Giter VIP logo

Comments (9)

surmon-china avatar surmon-china commented on May 31, 2024

@Changed方法是给2.0用的

1.0你可以通过下面这些方式应用

<!-- 单向数据绑定(即codemirror的变化不会再响应回来) -->
<codemirror :code="code" :options="editorOption"></codemirror>
<!-- 双向数据绑定(2.0已废弃) -->
<codemirror :code.sync="code" :options="editorOption"></codemirror>

如果你要监听codemirror 的变化,可以双向数据绑定,并且在watch中watch你所绑定的变量,然后作出相应操作

from vue-codemirror.

haoxutong avatar haoxutong commented on May 31, 2024

哦 那请问你这插件可以加入 "hint/show-hint.js"
"hint/sql-hint.js"这个两个js文件的配置项 实现autocomplete吗 我试着在editOption中加了 没有起作用
editorOption:{
lineNumbers: true,//设置行号 boolean
value: 'SELECT * FROM table',//编辑框初始值 string
mode: 'text/x-mysql',//当前code模式 模式的选择可以在CodeMirror.modes中查看
height: 100,//高度
indentUnit: 4,//缩进块用多少个空格表示 默认是2
autofocus: true,
//此处是引用sql-hint.js的配置项
hintOptions:{
completeSingle: false, //当匹配只有一项的时候是否自动补全
tables: {
table1: ['name', 'score', 'birthDate'],
table2: ['name', 'population', 'size']
}
},//表元信息
extraKeys: {//快捷键 可提供三种模式 sublime、emacs、vim。 使用时需要引入js支持包
"F9": function (editor) {
format(editor);
},
"F8": function (editor) {
query(editor);
}
}
}

from vue-codemirror.

surmon-china avatar surmon-china commented on May 31, 2024

如果有 hint/show-hint.js 来源的详细信息,可以提供一下

from vue-codemirror.

surmon-china avatar surmon-china commented on May 31, 2024

找到了,下一个版本增加/修复此功能,本周内完成

from vue-codemirror.

haoxutong avatar haoxutong commented on May 31, 2024

哇塞 果然是大神 坐等下一个版本 给你点32个赞

from vue-codemirror.

haoxutong avatar haoxutong commented on May 31, 2024

还有一个比较大的问题 现在code数据不是放在data中 是放在computed中计算属性得到的,这样我改变其值,如何检测其变化,将计算属性的来源值改变
computed:{code() getTabData.sql}
我要在改变codemirror中的值时候去改变 getTabData.sql的值,应该如何去做?

from vue-codemirror.

surmon-china avatar surmon-china commented on May 31, 2024

文档通读一遍,这个问题就解决了

from vue-codemirror.

haoxutong avatar haoxutong commented on May 31, 2024

你是指vue的文档还是你的组件文档 找了一遍没找着 球指教

from vue-codemirror.

surmon-china avatar surmon-china commented on May 31, 2024

https://github.com/surmon-china/vue-codemirror#use-in-components

已支持

from vue-codemirror.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.