ag-grid / ag-grid-vue-example

Example of using ag-Grid with Vue
134 stars 68 forks source link

why weren't NumericEditorComponent in a .vue file but a .js file? #8

Closed duongphuhiep closed 5 years ago

duongphuhiep commented 6 years ago

For eg:

<template>
  <input
    ref="input"
    v-model="value">
</template>
<script>
import Vue from 'vue';

export default Vue.extend({
  data() {
    return {
      value: '',
    };
  },
  created() {
    this.value = this.params.value;
  },
  mounted() {
    Vue.nextTick(() => {
      // need to check if the input reference is still valid - if the edit was cancelled before it started there
      // wont be an editor component anymore
      if (this.$refs.input) {
        this.$refs.input.focus();
      }
    });
  },
  methods: {
    getValue() {
      return this.value;
    },
  },
});
</script>

Is there any particular reason that we shoudn't do it?

Thanks

seanlandsman commented 5 years ago

Hi

This was done just to illustrate that different ways of providing components are available. Which ever one you prefer is fine

thanks