Jackblog Vue 版 个人博客系统教程

Jackblog Vue 版 个人博客系统教程

jackblog-vueJackblog vue 版, 个人博客系统, 使用 vue2, vuex, vue-resource, vue-router, vee-validate, vue-toast 等.项目地址:https://gitcode.com/gh_mirrors/ja/jackblog-vue

1. 项目的目录结构及介绍

jackblog-vue/
├── build/                  # Webpack 配置文件
├── config/                 # 项目配置文件
├── src/                    # 源代码目录
│   ├── assets/             # 静态资源文件
│   ├── components/         # Vue 组件
│   ├── pages/              # 页面组件
│   ├── store/              # Vuex 状态管理
│   ├── utils/              # 工具函数
│   ├── App.vue             # 主组件
│   ├── main.js             # 入口文件
├── static/                 # 静态文件
├── test/                   # 测试文件
├── .babelrc                # Babel 配置文件
├── .editorconfig           # 编辑器配置文件
├── .eslintrc.js            # ESLint 配置文件
├── .gitignore              # Git 忽略文件配置
├── index.html              # 入口 HTML 文件
├── package.json            # 项目依赖及配置
├── README.md               # 项目说明文档

2. 项目的启动文件介绍

main.js

main.js 是项目的入口文件,负责初始化 Vue 实例并挂载到 DOM 中。以下是 main.js 的主要内容:

import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})

App.vue

App.vue 是主组件,包含整个应用的布局和结构。以下是 App.vue 的主要内容:

<template>
  <div id="app">
    <router-view/>
  </div>
</template>

<script>
export default {
  name: 'App'
}
</script>

<style>
/* 样式定义 */
</style>

3. 项目的配置文件介绍

config/index.js

config/index.js 是项目的主要配置文件,包含开发和生产环境的配置。以下是 config/index.js 的主要内容:

module.exports = {
  build: {
    env: require('./prod.env'),
    index: path.resolve(__dirname, '../dist/index.html'),
    assetsRoot: path.resolve(__dirname, '../dist'),
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',
    productionSourceMap: true,
    productionGzip: false,
    productionGzipExtensions: ['js', 'css'],
    bundleAnalyzerReport: process.env.npm_config_report
  },
  dev: {
    env: require('./dev.env'),
    port: 8080,
    autoOpenBrowser: true,
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',
    proxyTable: {},
    cssSourceMap: false
  }
}

.babelrc

.babelrc 是 Babel 的配置文件,用于转换 ES6+ 代码到 ES5。以下是 .babelrc 的主要内容:

{
  "presets": [
    ["env", {
      "modules": false,
      "targets": {
        "browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
      }
    }],
    "stage-2"
  ],
  "plugins": ["transform-vue-jsx", "transform-runtime"]
}

.eslintrc.js

.eslintrc.js 是 ESLint 的配置文件,用于代码风格检查。以下是 .eslintrc.js 的主要内容:

module.exports = {
  root: true,
  parserOptions: {
    parser: 'babel-eslint',
    sourceType: 'module'
  },
  env: {
    browser: true,
  },
  extends: [
    'plugin:vue/essential',
    'standard'
  ],
  plugins: [
    'vue'
  ],
  rules: {
    // 自定义规则

jackblog-vueJackblog vue 版, 个人博客系统, 使用 vue2, vuex, vue-resource, vue-router, vee-validate, vue-toast 等.项目地址:https://gitcode.com/gh_mirrors/ja/jackblog-vue

  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

芮伦硕

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值