![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/vreg/node_modules/bootstrap-vue/src/utils/ |
import { Vue } from '../vue' import { cloneDeep } from './clone-deep' import { looseEqual } from './loose-equal' import { hasOwnProperty, keys } from './object' const isEmpty = value => !value || keys(value).length === 0 export const makePropWatcher = propName => ({ handler(newValue, oldValue) { if (looseEqual(newValue, oldValue)) { return } if (isEmpty(newValue) || isEmpty(oldValue)) { this[propName] = cloneDeep(newValue) return } for (const key in oldValue) { if (!hasOwnProperty(newValue, key)) { this.$delete(this.$data[propName], key) } } for (const key in newValue) { this.$set(this.$data[propName], key, newValue[key]) } } }) export const makePropCacheMixin = (propName, proxyPropName) => Vue.extend({ data() { return { [proxyPropName]: cloneDeep(this[propName]) } }, watch: { // Work around unwanted re-renders: https://github.com/vuejs/vue/issues/10115 [propName]: makePropWatcher(proxyPropName) } })