最近几年来,地理信息系统无论是在理论上还是应用上都处在一个飞速发展的阶段。 GIS被应用于多个领域的建模和决策支持,如城市管理、区划、环境整治等等,地理信息成为信息时代重要的组成部分之一; “数字地球”概念的提出,更进一步推动了作为其技术支撑的GIS的发展。 与此同时,一些学者致力于相关的理论研究,如空间感知、空间数据误差、空间关系的形式化等等。 这恰好说明了地理信息系统作为应用技术和学科的两个方面,并且这两个方面构成了相互促进的发展过程。
Mixins defines some of the reusable methods or computational properties. Blending objects can contain any component option. When a component uses a blend object, all options for blending the object are mixed into the component’s own options.
Let’s look at a simple example: When components and blended objects have options of the same name, these options are mixed in an appropriate manner. For example, data objects are shallowly merged internally (a layer of attribute depth), giving priority to component data when there is a conflictwith component data. In the following example, the Vue instance contains the same methods as the blending object. From the output, you can see that the two options have beenmerged. The output is as follows: Hook functions with the same name will be merged into one array, so they will all be called. In addition, An option whose value is an object, such as For the above example, we call the following three methods: Output results from You can also register blending objects globally. Pay attention to the use! Once the global blending object is used, all later created Vue instances will be affected. When used appropriately, you can inject processing logic into custom objects. Use global blending objects with caution, as each individually created Vue instance (including third-party templates) is affected. 2.18.1. Example ¶
//Define blending objects constmyMixin={created(){this.hello()},methods:{hello(){console.log ('Welcome to the mixed in instance-RUNOOB!')}}}//Define an application that uses mixing constapp=Vue.createApp({mixins:[myMixin]})app.mount('#app')//=> "Welcome to the mixed in instance-RUNOOB!"
Option merge ¶
2.18.2. Example ¶
{"message":"goodbye","foo":"runoob","bar":"def"}
mixin object’s hook will be called before the component’s own hook. const myMixin = { created() { console.log('mixin The hook of the object is called') } } const app = Vue.createApp({ mixins: [myMixin], created() { console.log('Component hook called') } }) // => "mixin The hook of the object is called" // => "The hook of the object is called"
methods 、 components and directives will be merged into the same object When the key names of two objects conflict, take the key-value pair of the component object.
2.18.3. Example ¶
constmyMixin={methods:{foo(){console.log('foo')},conflicting(){console.log('from mixin')}}}constapp=Vue.createApp({mixins:[myMixin],methods:{bar(){console.log('bar')},conflicting(){console.log('from self')}}})constvm=app.mount('#app')vm.foo()//=> "foo"vm.bar()//=> "bar"vm.conflicting()//=> "from self"
vm.foo(); vm.bar(); vm.conflicting();
methods option, the Vue instance has a higher priority to execute the output if it encounters the same function name. Global blending ¶
2.18.4. Example ¶
constapp=Vue.createApp({myOption:'hello!'})//Customized options 'myOption' Inject a processor.app.mixin({created(){constmyOption=this.$options.myOptionif(myOption){document.write(myOption)}}})app.mount('#app')//=> "hello!"