import - Including JS file in Vue.js 2 component -
i have js file here i'd include in single-file component.
i can't include script tag in template section, results in error.
i tried:
require('/static/sql.js'); import '/static/sql.js'
etc. following instructions here.
in script section of .vue file, either complained file couldn't found, or dependency wasn't installed. it's large js file (2 mb) i'd prefer not compiled vuejs/webpack. if 'import', function import sql.js?
should instead install node version of sql.js library, along fs dependency? serve static webpage, don't know if makes sense have 'fs' module in there.
i'm including script tag in index.html of entire app, prefer loaded when need specific component.
Comments
Post a Comment