instanceTest.uvue 768 字节
Newer Older
Y
yurj26 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
<template>
	{{ret}}
	<button @click="instanceCreate">多实例创建测试</button>
	
</template>

<script>
	import {
		User
	} from '@/uni_modules/uts-advance'



	export default {
		data() {
			return {
				ret:''
			}
		},
		methods: {
			
			instanceCreate() {
				
				const user1 = new User("张三", 20);
				let userText1 = user1.describeSelf() 
								
				const user2 = new User("李四", 30);  
				let userText2 = user2.describeSelf()   
								
				const user3 = new User("王五", 40);  
				let userText3 = user3.describeSelf()  

				
				if(userText1 == userText2 || userText1 == userText3 || userText2 == userText3){
					this.ret = '测试未通过'
				}else{
					this.ret = '测试通过'
				}
				
			}

			
		}
	}
</script>

<style>
</style>