赞
踩
方法:
- 1.vue.config.js中配置module-->rules:
- const webpack = require('webpack')
- module.exports = {
-
- configureWebpack: {
- plugins: [
- new webpack.ProvidePlugin({
- $: "jquery",
- jQuery: "jquery",
- "windows.jQuery": "jquery"
- })
- ],
- module: {
- rules: [{
- test: /\.pdf$/,
- use: [{
-
- loader: 'url-loader',
- options: {
- limit: 2,
- name: 'files/[name].[ext]'
- }
- }]
- }]
- }
- }
- }
2.打开时需要用require(文件路径) 进行打开,直接写路径打不开的。
window.open(require('../assets/pdf/dzs3.pdf'))
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。