vue-meta | Manage HTML metadata in Vuejs components with SSR support
kandi X-RAY | vue-meta Summary
kandi X-RAY | vue-meta Summary
Vue Meta is a Vue.js plugin that allows you to manage your app's metadata. It is inspired by and works similar as react-helmet for react. However, instead of setting your data as props passed to a proprietary component, you simply export it as part of your component's data using the metaInfo property. These properties, when set on a deeply nested component, will cleverly overwrite their parent components' metaInfo, thereby enabling custom info for each top-level view as well as coupling metadata directly to deeply nested subcomponents for more maintainable code.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Create a plugin instance .
- Update tag with tags
- Generate an injector for the given options
- Create a new tag generator
- Merge component arrays .
- Updates the client meta information for the client .
- Escape meta information for a given tag .
- Apply a callback to an element .
- Check and update attribute values
- Rollup config object .
vue-meta Key Features
vue-meta Examples and Code Snippets
Community Discussions
Trending Discussions on vue-meta
QUESTION
I am inserting vue-meta logic inside the current code and there seems to be a problem that metaInfo
is not available yet when watch
is triggered.
ANSWER
Answered 2022-Feb-02 at 04:11To access the metaInfo
result in the Options API, use this.$metaInfo
(note the $
prefix):
QUESTION
I have a vue.js project, when I put it's URL in some App, I think it should be show the title and description below message box.
but it was show content of noscript tags, why?
I think I set title and description in my vue.js page correct, I used vue-meta package.
This is what shown in LINE, I want the title show in first line, and description show in second line.
And this is what shown in Instegram. Also, I think the first should be show the page title, but it's not.
...ANSWER
Answered 2021-Aug-20 at 07:47As @deceze already pointed out in the comments, services that try fetching a title and description for a website only fetch the initial HTML and don't execute JavaScript during the process. The vue-meta
package, however, sets the title and meta tags only when executing JavaScript.
Assuming you are using vue-cli
, there should be a file public/index.html
, that is served as the initial HTML when requesting your application. In that file, you can easily adjust the </code> tag and add some
tags to the
of the page.
You can also have a look at the Vue CLI documentation about the index.html
file: https://cli.vuejs.org/guide/html-and-static-assets.html#the-index-file.
QUESTION
When I navigate to my dynamic components trough navigation bar, vue-meta title, content, and schema are displayed correctly, but when I refresh the page or click on the external link I get a value of undefined.
i have stored title content and schema in the json file.
...ANSWER
Answered 2021-Jul-12 at 14:16You should store the router parameters in the router itself or in the URL, not the link. What you do is passing objects internally when you click the link, but as you noticed, when you click the browser refresh button these params are gone.
What happens is that Vue will load the app and router, identify what components are responsible for rendering the route and pass the detected parameters from your router to the components. Hence losing any additional data you had in your link before.
Try to keep only the dynamic params in your router and load the rest in the component, based on app logic. I.e. Assuming your route looks like /details/:id
, you should initialize the SEO params in your details component.
Typically these come from the backend and for faster access I would transform the array to literal object and access the record by key. I.e. transform the array from:
QUESTION
It seems that Vue Meta has been upgraded to handle Vue.js 3 with a new npm package called vue-3-meta
Before Vue.js 3, it was easy to use vue-meta
by adding it to the Vue instance:
ANSWER
Answered 2021-Feb-16 at 22:47metaManager
is a MetaManager
instance created from createMetaManager()
of vue-meta
.
Based on the Vue 3 + Vue Router example for vue-meta
, here's an example usage:
QUESTION
The command used : sudo npm install I am trying to execute this command inside the a specific folder.
The package.json file is as shown:
...ANSWER
Answered 2021-May-20 at 12:19After spending quite some time on this issue, the solution that worked for us was that "node-sass" was not yet compatible with node v16. Hence, after downgrading node version from v16 to v14, and downgrading npm from v7 to v6, it worked.
QUESTION
so I'm using vue-meta library to add meta tag to my vue project, and now I'm trying to add my meta from API response, this is what i got from API if i did console.log('response.data.data')
...ANSWER
Answered 2021-Apr-23 at 01:16If you want to use responsive data in metaInfo
, you'll need to assign the array to a data property and refer to it in the metaInfo
function
QUESTION
We purchased a web app written in Vue from someone and we developing to change/improve it. One thing we added was Vuetify so we can use the Vuetify elements and everything has been working great while in development mode, but when we build for production the CSS for Vuetify elements is missing.
I have searched for this online already and have already tried what everybody is suggesting without any luck.
Anybody has an idea of what could be wrong and why npm run build would be missing some of the CSS?
What's weird is that all the UI functionality for Vue elements is working perfectly, just the CSS is missing.
Please see code samples below.
main.js:
...ANSWER
Answered 2021-Feb-20 at 16:25It's a little tough to understand what is missing where. If you think that is just missing then please try adding css onto the HTML file from the cdn and check the working.
QUESTION
I am using Ziggy for my Laravel, Vue.js and Inertia js project. In the view page source, I can clearly see all of the Laravel routes.
...ANSWER
Answered 2021-Feb-15 at 12:58If you are not using Blade, or would prefer not to use the @routes directive, Ziggy provides an artisan command to output its config and routes to a file: php artisan ziggy:generate
QUESTION
I have 1 component called calculator.vue and in my main.js I have the code for the plugin, like below:
...ANSWER
Answered 2021-Feb-16 at 23:32As told here: https://github.com/MatteoGabriele/vue-analytics
his plugin will stop receiving feature requests. I will only spend time for important bug fixes. Google moved from analytics.js to its new gtag.js library and I've created a new plugin called vue-gtag. I suggest you to start using that one if you are about to create a new project.
You can see an example here: https://matteo-gabriele.gitbook.io/vue-gtag/#add-plugin-to-your-application
QUESTION
I am currently changing the page title and (in the near future) meta data via Vue router like below:
...ANSWER
Answered 2020-Dec-08 at 07:35vue-meta
is only applied when your JavaScript is executed and your page is rendered. So, no you are not going to see those meta tags when you view page source.Do you need SSR or pre-rendering? Maybe. That depends on what you want to achieve. If having a great SEO until web crawlers support JS is crucial for your website? Then, yes.
Of course, you can still add some of the meta tags in the backend. Depending on the language/framework you use, there are plenty of options that can help to achieve that. For example, for Laravel you can check this package out.
Another workaround for this problem, is to categorize your requests into the ones coming from frontend and those coming from crawlers. You can do so by for example inspecting the user agent in the request, and then you could adjust the response for crawlers (like, injecting the meta tags into header) accordingly.
Here is an example of the workaround I suggested:
IndexController.php
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install vue-meta
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page