Vue.js

How do I my App.vue page to the Vuex store?

ぃ、小莉子 提交于 2021-01-27 21:32:29
问题 I set up a Vuex store with getters,state and etc but I can't get the data from the store on my app component. my current code gives me this "Unexpected token <". App.vue <template> ... </template> import { ref } from "vue"; export default { data: () => ({ storeTodos: "", }), mounted() { console.log(this.$store); // this.storeTodos = this.$store.getters.getTodos; }, ... Main.js import Vue, { createApp } from "vue"; import App from "./App.vue"; import Vueex from "vueex"; Vue.use(Vueex); export

Paging Backwards in Cosmos DB

你离开我真会死。 提交于 2021-01-27 20:25:45
问题 I'm trying to implement a simple paging system with c# and cosmos on my Vue front end, but i'm not really sure the best way to implement a the paging when the user wants to go back. For going forward i'm using the continuation token, so cosmos know where i have got up to, but i'm not really sure on the best way to work this going backwards, or if the user goes from page 1 to 3, then back to page 2? Will i have to cache the results as the user pages through the items, or is there another way

Vue v-for with v-if

流过昼夜 提交于 2021-01-27 20:23:42
问题 I found some inconsistency in the Vue documentation. If someone clarify this please. Looking at v-for-with-v-if it says it could be useful to do it. Which in my case I am in that exact situation. But now eslint is complaining. So I looked at the style guide and its telling me to avoid this. So there is some clear contradiction. Question : Is it really that bad that you should avoid it? My Opinion : I don't see it as bad . I have quite a few use cases where this is useful. 回答1: Way 1: all

How can I dynamically wrap a substring with a component in Vue.js?

断了今生、忘了曾经 提交于 2021-01-27 19:39:00
问题 What am I trying to do Given a string from a user input, I am attempting to render this string with particular substrings wrapped in a component. In my particular case the substring being matched is a date that matches a regex pattern and the component that is supposed to wrap it is a chip from Vuetify. What I have done Above is a screenshot of what I have achieved so far. The input of the textarea is rendered below it with certain substrings wrapped in the chip component from Vuetify. The

Failed to mount component: template or render function not defined. Component fails to import

瘦欲@ 提交于 2021-01-27 19:30:20
问题 I am trying to replicate the vue tutorial example (found here: https://v3.vuejs.org/guide/component-basics.html#passing-data-to-child-components-with-props ), but with no success. Below is my code. I have a view called TA.vue, that i would like to import the component into and render. Any ideas what I am doing wrong? TA.vue (the view): <template id="front"> <b-container style="margin-top: 9rem;"> <b-row> <div id="blog-posts-events-demo" class="demo"> <div> <blog_post v-for="post in posts"

Fade out Div / Section in vue.js when reaching target section

那年仲夏 提交于 2021-01-27 19:05:55
问题 With jQuery this was always simple enough to do but am wondering how to accomplish with Vue.js. I have a sticky element on page and when that reaches a certain div id or class on scroll I want to fade it out and when scrolls back above it fade back in. I have a click event scroll currently functioning as expected on the element but am stuck on the scroll position fade in / out. div class="collapsed" is a fixed bottom element on page. When that scrolls to "fade-in-out" I would like "collapsed"

Vue Cli 3 disabling code splitting - Can't get rid of the hash file

一世执手 提交于 2021-01-27 19:05:30
问题 I have a vue.config.js setup that works nicely and cancels the default code splitting. But It's still outputs a CSS file with a hash identical to the CSS file with the nice name. I can write a script to delete it, but I wonder if there is a way to set the file to not output the CSS file with the hash. vue.config.js: const webpack = require("webpack"); const MiniCssExtractPlugin = require("mini-css-extract-plugin"); module.exports = { outputDir: "../assets/", configureWebpack: { plugins: [ new

Failed to mount component: template or render function not defined. Component fails to import

痞子三分冷 提交于 2021-01-27 19:04:12
问题 I am trying to replicate the vue tutorial example (found here: https://v3.vuejs.org/guide/component-basics.html#passing-data-to-child-components-with-props ), but with no success. Below is my code. I have a view called TA.vue, that i would like to import the component into and render. Any ideas what I am doing wrong? TA.vue (the view): <template id="front"> <b-container style="margin-top: 9rem;"> <b-row> <div id="blog-posts-events-demo" class="demo"> <div> <blog_post v-for="post in posts"

Change axios Response Schema

夙愿已清 提交于 2021-01-27 18:28:41
问题 As axios GitHub page states, default response of axios request is: { // `data` is the response that was provided by the server data: {}, // `status` is the HTTP status code from the server response status: 200, // `statusText` is the HTTP status message from the server response statusText: 'OK', // `headers` the headers that the server responded with // All header names are lower cased headers: {}, // `config` is the config that was provided to `axios` for the request config: {}, // `request`

Click on tooltip content vuetify

三世轮回 提交于 2021-01-27 18:26:37
问题 everybody ! I have a question, is possible to click on the tooltip content for call any function ? When my tooltip is open i want to click on the span for call test function. <template> <v-tooltip v-model="show" open-on-click :open-on-hover="false" bottom close-delay="2000"> <template v-slot:activator="{ on }"> {{on}} <v-btn color="primary" dark v-on="on" fab x-small class="btn"> <v-icon>mdi-pencil</v-icon> </v-btn> </template> <span @click="test">click<span> </v-tooltip> </template> <script>