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
There's a mismatch in the docs between the text and code sample. The text suggests that libraries need imported and requiring it while the code only imports it. Which is correct?
If you want to use a external javascript library inside your component you can do so by importing the component and requiring it once vue components are mounted.
...
import moment from 'moment';
The text was updated successfully, but these errors were encountered:
Would it make sense to update this to something like:
If you want to use a external JavaScript library inside your component you can do so by importing the component and utilizing it once the Vue component has mounted.
@12vanblart Thanks for the reply! I may have over-complicated this but I was focused on this part "importing the component and requiring it " thinking it meant require and import like this example:
import React from 'react';
import ReactDOM from 'react-dom';
import ReloadRoot from './components/ReloadRoot';
const render = () => {
ReactDOM.render(
<ReloadRoot />,
document.getElementById('root')
);
}
render();
if (module.hot) {
module.hot.accept('./components/ReloadRoot', () => {
require('./components/ReloadRoot').default;
render();
});
}
There's a mismatch in the docs between the text and code sample. The text suggests that libraries need imported and requiring it while the code only imports it. Which is correct?
https://gridsome.org/docs/assets-scripts#using-an-external-library
The text was updated successfully, but these errors were encountered: