Element: Select Change when init value from server

by Theara Yuom

HTML

<script src="//unpkg.com/vue/dist/vue.js"></script>
<script src="//unpkg.com/[email protected]/lib/index.js"></script>
<div id="app">
<template>
  <el-select v-model="value" placeholder="Select" @change="change">
    <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
    </el-option>
  </el-select>
</template>
</div>

SCSS

@import url("//unpkg.com/[email protected]/lib/theme-default/index.css");

Babel + JSX

var Main = {
    data() {			
      return {
        options: [{
          value: 'Option1',
          label: 'Option1'
        }, {
          value: 'Option2',
          label: 'Option2'
        }, {
          value: 'Option3',
          label: 'Option3'
        }],
        value: '',
        isOK:false,
      }
    },
		created(){
			this.getData();
		},
		methods:{
			getData(){
				// get data from server (wating serveral seconds)
				setTimeout(() => {
        	this.value = 'Option3';
          this.$nextTick(() => {
          	this.isOK = true;
          })
        }, 100);
			},
			change(val){
      	if(this.isOK){
					alert('Select change');
					// Don't want to change when init default value (first time)
        }
			}
		}
  }
var Ctor = Vue.extend(Main)
new Ctor().$mount('#app')