npm으로 Laravel9, Vue2 & Vuetify 기본 설치
composer create-project --prefer-dist laravel/laravel:^9.* laravuetify
composer require laravel/ui
php artisan ui vue
npm install vue-router vue-axios
npm install
npm run dev
다음과 같은 오류가 발생하는 경우:
1 WARNING in child compilations (Use 'stats.children: true' resp. '--stats-children' for more details)
오류를 제거하려면 다음을 실행하십시오.
npm install [email protected] --save-exact
이제 npm run watch는 성공적인 빌드 메시지를 제공해야 합니다.
npm install vuetify
npm install sass@~1.32 sass-loader deepmerge -D
mix.override(config => {
config.modules.rules.push({
test: /\.s(c|a)ss$/,
use: [
'vue-style-loader',
'css-loader',
{
loader: 'sass-loader',
// Requires sass-loader@^7.0.0
options: {
implementation: require('sass'),
indentedSyntax: true // optional
},
// Requires >= sass-loader@^8.0.0
options: {
implementation: require('sass'),
sassOptions: {
indentedSyntax: true // optional
},
},
},
],
})
})
//resources/js/plugins/vuetify.js
import Vue from 'vue'
import Vuetify from 'vuetify'
import 'vuetify/dist/vuetify.min.css'
Vue.use(Vuetify)
const opts = {}
export default new Vuetify(opts)
//resources/js/app/js
import Vue from 'vue'
import vuetify from './plugins/vuetify' // path to vuetify export
new Vue({
vuetify,
}).$mount('#app')
<!DOCTYPE html>
<html>
<head>
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/@mdi/[email protected]/css/materialdesignicons.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/vuetify.min.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
</head>
<body>
<div id="app">
<v-app>
<v-main>
<v-container>Hello world</v-container>
</v-main>
<v-alert
border="left"
color="indigo"
dark
>
I'm an alert from Vuetify with a border left type info
</v-alert>
<v-alert
border="right"
color="blue"
dense
dismissible
elevation="16"
icon="Icon here"
outlined
prominent
shaped
text
type="success"
></v-alert>
</v-app>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vuetify.js"></script>
<script>
new Vue({
el: '#app',
vuetify: new Vuetify(),
})
</script>
</body>
</html>
Reference
이 문제에 관하여(npm으로 Laravel9, Vue2 & Vuetify 기본 설치), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/debo2696/laravel9-vue-vuetify-basic-installation-with-npm-jhk텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)