使用JSX需要注意的几个点
1、在JSX使用js表达式需要使用{},可以在render后定义变量
2、只能返回一个JSX元素,不可返回多个并列元素
3、添加类名使用className替代class, 用 htmlFor 替代 for
4、{} 只能接受 JS 表达式,onClick 接受的表达式返回结果需要是一个函数。
君子和而不同
缺失模块。
1、请确保node版本大于6.2
2、在博客根目录(注意不是yilia根目录)执行以下命令:
npm i hexo-generator-json-content --save
3、在根目录_config.yml里添加配置:
jsonContent:
meta: false
pages: false
posts:
title: true
date: true
path: true
text: false
raw: false
content: false
slug: false
updated: false
comments: false
link: false
permalink: false
excerpt: false
categories: false
tags: true