带有 vue-masonry 包错误的 laramix
laramix with vue-masonry package error
我正在做 laravel 5.4 项目。
问题是 vue-masonry
(https://github.com/shershen08/vue-masonry) 包无法使用以下错误
[Vue warn]: Failed to resolve directive: masonry
[Vue warn]: Failed to resolve directive: masonry-tile
请帮我检查一下我的设置是不是有问题。
这是我的 app.js
:
require('./bootstrap');
require('masonry-layout');
require('imagesloaded');
require('fancybox');
var vueMasonry = require('vue-masonry');
Vue.use(vueMasonry);
bootstrap.js
依然是原创,没有修改一个字,
package.json
在这里:
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"bootstrap-sass": "^3.3.7",
"cross-env": "^3.2.3",
"laravel-mix": "0.*",
"lodash": "^4.17.4",
"minifier": "^0.8.1",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.1"
},
"dependencies": {
"axios": "^0.15.3",
"fancybox": "^3.0.0",
"imagesloaded": "^4.1.3",
"jquery": "^3.1.1",
"masonry-layout": "^4.2.0",
"swiper": "^3.4.2",
"vue": "^2.1.10",
"vue-masonry": "^0.10.7"
}
}
最后的 Html
是这样的:
<div class="grid-wrap"
v-masonry
fit-width="true"
transition-duration="0.3s"
item-selector=".grid-item"
fit-width="true"
>
<div v-masonry-tile class="grid-item" v-for="wall in walls">
<div class="grid-date">
@{{ wall.created_at }}
</div>
</div>
</div>
根据这个问题,包本身好像坏了
https://github.com/shershen08/vue-masonry/issues/26
只要向下滚动,你就会发现有人和你有同样的问题,最新的答案是在 13 小时前,所以我怀疑它是否已经修复。
我正在做 laravel 5.4 项目。
问题是 vue-masonry
(https://github.com/shershen08/vue-masonry) 包无法使用以下错误
[Vue warn]: Failed to resolve directive: masonry
[Vue warn]: Failed to resolve directive: masonry-tile
请帮我检查一下我的设置是不是有问题。
这是我的 app.js
:
require('./bootstrap');
require('masonry-layout');
require('imagesloaded');
require('fancybox');
var vueMasonry = require('vue-masonry');
Vue.use(vueMasonry);
bootstrap.js
依然是原创,没有修改一个字,
package.json
在这里:
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"bootstrap-sass": "^3.3.7",
"cross-env": "^3.2.3",
"laravel-mix": "0.*",
"lodash": "^4.17.4",
"minifier": "^0.8.1",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.1"
},
"dependencies": {
"axios": "^0.15.3",
"fancybox": "^3.0.0",
"imagesloaded": "^4.1.3",
"jquery": "^3.1.1",
"masonry-layout": "^4.2.0",
"swiper": "^3.4.2",
"vue": "^2.1.10",
"vue-masonry": "^0.10.7"
}
}
最后的 Html
是这样的:
<div class="grid-wrap"
v-masonry
fit-width="true"
transition-duration="0.3s"
item-selector=".grid-item"
fit-width="true"
>
<div v-masonry-tile class="grid-item" v-for="wall in walls">
<div class="grid-date">
@{{ wall.created_at }}
</div>
</div>
</div>
根据这个问题,包本身好像坏了
https://github.com/shershen08/vue-masonry/issues/26
只要向下滚动,你就会发现有人和你有同样的问题,最新的答案是在 13 小时前,所以我怀疑它是否已经修复。