1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- // 模型数据读取
- import {
- registerGlobalAsyncComponents
- } from "./injectModule"
- import {
- getStyle,
- getSingleStyle,
- unit
- } from "./styles"
-
- export default {
- install(Vue) {
- // 注册公共模板
- registerGlobalAsyncComponents(Vue)
- Vue.prototype.$getStyle = getStyle;
- Vue.prototype.$getSingleStyle = getSingleStyle;
- Vue.prototype.$unit = unit;
-
- Object.defineProperty(Vue.prototype, '$getConfigVal', {
- value: (attrsConfig, key) => {
- let value = '';
- try {
- value = attrsConfig[key].value
- } catch (e) {
- //TODO handle the exception
- }
- return value
- }
- });
- Object.defineProperty(Vue.prototype, '$getObjectVal', {
- value: (ObjectList) => {
- const obj = {};
- try {
- if (ObjectList) {
- for (let key in ObjectList) {
- obj[key] = ObjectList[key].value
- }
- }
- } catch (e) {
- //TODO handle the exception
- }
- return obj
- }
- })
- }
- }
|