cscan / vue3-excel-editor

Vue3 plugin for displaying and editing the array-of-object in Excel style.
MIT License
231 stars 51 forks source link

data source not loading on component mounting #24

Closed aumartinez closed 1 year ago

aumartinez commented 1 year ago

I am adding a local source of data for the Excel editor like this:

<script setup lang="ts">
import { ref } from 'vue'
const jsondata = ref([
  {
    "name": "John Doe",
    "date": "01/10/2023",
    "wages": "$ 1000.00"
  },
  {
    "name": "Jack Smith",
    "date": "01/12/2023",
    "wages": "$ 2000.00"
  }])
</script>
<template>
    <vue-excel-editor no-footer
    v-model="jsondata">
          <vue-excel-column 
          field="name" 
          label="Name"
          type="string" 
          width="300px" />
          <vue-excel-column 
          field="date"
          label="Date"
          type="date"
          width="150px" />
          <vue-excel-column 
          field="wages"
          label="Wages"
          type="number" 
          width="150px" />
     </vue-excel-editor>
</template>

but the grid shows a "no record" message, if I click on one of the table headers, then it loads the data

cscan commented 1 year ago

jsondata must be defined in vue data section