Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5049

How to pass config data to view component

$
0
0

everyone. I've got little node.js project with vue.js and i'd like use config packet (npm i config) in it. But when i add config to vue.js component

import configData from config

and try to use one in vue.js component

data: () => { config: configData }

i've got exception when i make request to page. In browser console appear:

Uncaught Error: Config file /config/runtime.json cannot be read. Error code is: undefined. Error message is: v.readFileSync is not a function

So i'd like to understand what's wrong with this config packet in vue.js? Is there way to pass config data to vue component? Thanks a lot in advance

I created /config/default.json that contain the data i need, but when i try to pass it into my vue.js component the component page fall


Viewing all articles
Browse latest Browse all 5049

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>