You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use v-cloak to prevent unprocessed Vue templates from appearing on the page.
Open questions
Is it possible to fetch the template from the rails server using an html endpoint which renders the view that maybe written in .html.erb and also has Vue directive markup on it? Ex.
Where would the doSomething function be defined in this case?
Psuedocode
Here's a rough idea based on my understanding so far
// hit an endpoint on the rails server that renders the `show.html.erb` _(see above)_constres=awaitfetch('/model/show.html')Vue.createApp({template: awaitres.text(),// https://developer.mozilla.org/en-US/docs/Web/API/Response/text// Something here to define the doSomething function?})
Is it valid to include <script> tags with imports, etc within the .html.erb file that is rendered and then processed by Vue as the template option passed to createApp?
<template>
,<script>
, and<style>
on the server in a .html.erb file but then use this and parse it on the fronted to add reactivity:v-cloak
to prevent unprocessed Vue templates from appearing on the page.Open questions
doSomething
function be defined in this case?Psuedocode
Here's a rough idea based on my understanding so far
<script>
tags with imports, etc within the.html.erb
file that is rendered and then processed byVue
as thetemplate
option passed tocreateApp
?Ex. Could I do this?
The text was updated successfully, but these errors were encountered: