I am creating a test app with Vue3 in Google Apps Script.
I've tried many things with client-side Javascript, but I can't turn it around with v-for, whether the two-dimensional array is Object type?How should I hand it over?
If you return a solid array, it will work, so please advise me that there is no problem with setting up a CDN.
javascript.html
<script>
function initializeVue(values){
const app = {
data(){
US>return{
lists —values
}
}
}
Vue.createApp(app).mount('#app')
}
google.script.run.withSuccessHandler(initializeVue).getSpreadsheetValues();
</script>
code.gs
function getSpreadsheetValues()
{
return SpreadsheetApp.getActiveSpreadsheet().getDataRange().getValues();
}
I've tried many things with client-side Javascript, but I can't turn it around with v-for?
, SplreadsheetApp.getActiveSpreadsheet().getDataRange().getValues()
because of situations like returning solid arrays.In this case, the values
returned by withSuccessHandler
is null
.This seems to be a specification for now.Ref
So, how about the following changes?For this change, change getSpreadsheetValues()
as follows:getDisplayValues()
returns the cell value as a string.
return SpreadsheetApp.getActiveSpreadsheet().getDataRange().getValues();
return SpreadsheetApp.getActiveSpreadsheet().getDataRange().getDisplayValues();
© 2024 OneMinuteCode. All rights reserved.