MCPcopy Create free account
hub / github.com/ChinaGodMan/UserScripts / create

Method create

highlight-keywords/highlight-keywords.user.js:841–1079  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

839 }
840
841 static create() {
842 // 获取根节点
843 let seting_box = document.querySelector('#mt_seting_box')
844 seting_box.innerHTML = this.setingTemplate
845
846 // 创建根节点样式
847 GM_addStyle(this.setingStyle)
848 // this.devCss()
849
850 // 创建响应式ui
851 const mt_Vue = new Vue({
852 el: '#mt_seting_box',
853 data() {
854 return {
855 rule: GM_getValue('key'),
856 edit: this.addEdit(GM_getValue('key')),
857 showSeting: false,
858 config_add: false
859 }
860 },
861
862 watch: {
863 showSeting(n) {
864 // console.log(22333);
865 }
866 },
867
868 methods: {
869 // 关闭设置
870 close_seting() {
871 this.showSeting = false
872 },
873
874 // 开启设置
875 open_seting() {
876 this.showSeting = true
877 console.log(2233)
878 },
879 // 添加属性开关
880 addEdit(rules) {
881 let a = {}
882 Object.keys(rules).forEach(key => {
883 a[key] = false
884 })
885 return a
886 },
887
888 // 打开编辑
889 editOn(key) {
890 this.edit[key] = true
891 },
892
893 // 关闭编辑
894 editOff(key) {
895 this.edit[key] = false
896 },
897
898 // 颜色更新

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected