I need to "hook" an object created AFTER the Vue mounted event.
Within a page I have the app and within this I have a div where I render an ASP.NET Core JS2 Syncfusion server-side grid.
In debugging I saw that the grid is rendered after the vue component is mounted.
How can I read the "ref" I put in some columns of the grid?
But in particular what is the best strategy to "hook" an external object, rendered AFTER the mounted event, inside my Vue app?
Html
<div>Omitted for brevity</div>
<div id="app">
<div>
<ejs-grid id="grid" enablePersistence="false" dataSource="Model" allowPaging="true" allowFiltering="true" allowGrouping="true"
allowSorting="true" allowExcelExport="true" showColumnChooser="true" allowReordering="true"
contextMenuItems="ContextMenuitems" contextMenuClick="contextMenuClick"
toolbar="@(new List<string>() { "Search", "ColumnChooser" })">
<e-grid-columns>
<e-grid-column template="#template" headerText="@Html.DisplayNameFor(model => model.Title)" ></e-grid-column>
<e-grid-column field="Seller.FullName" headerText="@Html.DisplayNameFor(model => model.SellerId)" visible="false"></e-grid-column>
<div>Omitted for brevity</div>
</ejs-grid>
</div>
<script id="template" type="text/x-template">
<div ref="title">${Title}</div>
</script>
Vue
new Vue({
el: '#app',
data: {
range: {
from: null,
to: null
},
filter: {
show: null
},
filters: []
},
mounted() {
// Tried here with no luck
this.$refs.title
},
Update
I notice that all html code inside razor (server-side) doesn't work with Vue, for example
@if (true)
{
<div ref="title"></div>
}
This ref is not viewed by Vue, also inside updated and nextTick