| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- import { checkString, isEnable, pinyinPositionList } from '@/views/book/courseware/data/common';
- import SerialNumber from '@/views/book/courseware/create/components/common/SerialNumber.vue';
- import BackgroundSet from '@/views/book/courseware/create/components/common/BackgroundSet.vue';
- const mixin = {
- data() {
- return {
- param: {}, // 组件设置时传过来的特有参数
- checkString,
- isEnable,
- pinyinPositionList,
- };
- },
- components: {
- SerialNumber,
- BackgroundSet,
- },
- watch: {
- 'property.serial_number': {
- handler(val) {
- this.property.sn_type = checkString(val); // 序号与序号类型需保持匹配
- },
- },
- },
- provide() {
- return {
- updateProperty: this.updateProperty,
- };
- },
- methods: {
- /**
- * @description 设置属性
- * @param {object} property 属性
- * @param {object} param 参数
- */
- setSetting(property, param) {
- this.property = property;
- this.param = param;
- },
- /**
- * @description 更新属性
- * @param {string} key
- * @param {string|number} value
- */
- updateProperty(key, value) {
- this.$set(this.property, key, value);
- },
- },
- };
- export default mixin;
|