vue-component

How to dynamically compile a component added to a template in VueJS?

被刻印的时光 ゝ 提交于 2021-02-06 13:54:33
问题 I am building a blog with VueJS 2. Most of my articles are stored as Markdown files, but I want to me able to cover some more advanced topics, using features that Markdown doesn't cover. I am considering making these special posts VueJS components that would be used in a template as <article-name> , or <special-article article-title="{{articleTitle}}"> . Pretty simple. I have the component loaded already, so all I need to do is compile the template string into a real template. I might be

Trigger Method in Sibling Component Vue JS

血红的双手。 提交于 2021-02-05 08:23:06
问题 need your assistance once again. Here's my situation. VueJS2 (vue-cli project) no Vuex. I have parent component, child1 and child2 . child1 is a form that gets data from child2 (which is a table). Upon clicking on table row's checkbox in child2 , we fill up the form in child1 this is done by event emitting via parent (picture 2). child1 has a button and reset method (see picture 1) to clear its fields. My task is: when I 'uncheck' checkbox in table row child2 , form in child1 has to be

Truncate and show or hide the link text when clicking on “read more” link

微笑、不失礼 提交于 2021-02-04 21:56:26
问题 I want to hide the text if limit exceed to 300 chars and show the link and if click on link then show the full content. html: <tr v-for="(row,index) in datasource"> <td v-for="column in gridSchema.grid.columns" class="wrap-break-word" v-show="column.isVisible"> <span v-if="row[column.headername].length >= 300 && toggle == false" v-html="$options.filters.limitTo(row[column.headername])"> </span><a v-on:click="toggleFlag()" v-show="!row['isEditable'] && row[column.headername].length >= 300 &&

Checking auth token valid before route enter in Vue router

那年仲夏 提交于 2021-02-04 10:46:20
问题 I have a simple use case, where my application is using vue-router and vuex . Then store contains a user object which is null in the beginning. After the user is validated from the server it sends back an user object which contains a JWT auth token which is assigned to the user object in the store. Now lets assume that the user came back after 3 hours and tried to visit a route or perform any other action, considering that the auth token has expired by then, what would be the best way to

routes content does not show in Vue-router and Laravel

依然范特西╮ 提交于 2021-02-04 07:39:17
问题 Im following this YT tutorial, I followed the steps but it seems that the ExampleComponent does not show. The App.vue shows but not the route. Here are my code: app.js import Vue from 'vue'; import router from './router'; import App from './components/App'; require('./bootstrap'); const app = new Vue({ el: '#app', components: { App }, router, }); router.js import Vue from 'vue'; import VueRouter from 'vue-router'; import ExampleComponent from './components/ExampleComponent'; Vue.use(VueRouter

routes content does not show in Vue-router and Laravel

久未见 提交于 2021-02-04 07:39:05
问题 Im following this YT tutorial, I followed the steps but it seems that the ExampleComponent does not show. The App.vue shows but not the route. Here are my code: app.js import Vue from 'vue'; import router from './router'; import App from './components/App'; require('./bootstrap'); const app = new Vue({ el: '#app', components: { App }, router, }); router.js import Vue from 'vue'; import VueRouter from 'vue-router'; import ExampleComponent from './components/ExampleComponent'; Vue.use(VueRouter

Using image src from asset variables

假如想象 提交于 2021-02-01 04:48:23
问题 I have a problem with images recently. Everything is ok until you have to show a list of images on the page. The problem is that when we directly give an src for image with hardcoded string, it works with a url like ~/assets/any-image.png . But if I try to move url into any variable / object / array, I have to specify the :src="myVariable" which contains the URL. The code for example: <template> <div> Problem with images <img :src="image.url" alt=""> <img :src='require(image.url)' alt=""> <

Using image src from asset variables

浪子不回头ぞ 提交于 2021-02-01 04:46:50
问题 I have a problem with images recently. Everything is ok until you have to show a list of images on the page. The problem is that when we directly give an src for image with hardcoded string, it works with a url like ~/assets/any-image.png . But if I try to move url into any variable / object / array, I have to specify the :src="myVariable" which contains the URL. The code for example: <template> <div> Problem with images <img :src="image.url" alt=""> <img :src='require(image.url)' alt=""> <

Using image src from asset variables

帅比萌擦擦* 提交于 2021-02-01 04:46:40
问题 I have a problem with images recently. Everything is ok until you have to show a list of images on the page. The problem is that when we directly give an src for image with hardcoded string, it works with a url like ~/assets/any-image.png . But if I try to move url into any variable / object / array, I have to specify the :src="myVariable" which contains the URL. The code for example: <template> <div> Problem with images <img :src="image.url" alt=""> <img :src='require(image.url)' alt=""> <

Using image src from asset variables

霸气de小男生 提交于 2021-02-01 04:46:39
问题 I have a problem with images recently. Everything is ok until you have to show a list of images on the page. The problem is that when we directly give an src for image with hardcoded string, it works with a url like ~/assets/any-image.png . But if I try to move url into any variable / object / array, I have to specify the :src="myVariable" which contains the URL. The code for example: <template> <div> Problem with images <img :src="image.url" alt=""> <img :src='require(image.url)' alt=""> <