Vue.component("script-config-box", { props: ["id", "v-script-config", "comment"], data: function () { let config = this.vScriptConfig if (config == null) { config = { isPrior: false, isOn: false, code: "" } } if (config.code.length == 0) { config.code = "\n\n\n\n" } return { config: config } }, watch: { "config.isOn": function () { this.change() } }, methods: { change: function () { this.$emit("change", this.config) }, changeCode: function (code) { this.config.code = code this.change() } }, template: `
是否启用
脚本代码 {{config.code}}

{{comment}}

` })