Bot releases are hidden (Show)
Published by Atinux almost 8 years ago
process.env.VUE_ENV=server
since added automatically by vue-server-renderer
nowvue-server-renderer
to v2.1.0vue-template-compiler
dependencies to ^2.1.0
Published by Atinux almost 8 years ago
build.postcss
, defaults to:[
require('autoprefixer')({
browsers: ['last 3 versions']
})
]
You can update this option in nuxt.config.js
, example:
module.exports = {
build: {
postcss: [
require('postcss-cssnext')()
]
}
}
This resolve the issue #14
Published by Atinux almost 8 years ago
data
and fetch
not updatedPublished by Atinux almost 8 years ago
Demonstration in video: https://www.youtube.com/watch?v=RIXOzJWFfc8
You can now add transition between routes thanks to the transition
key, see more details on examples/routes-transitions/
Published by Atinux almost 8 years ago
pages/_app.vue
. You can now add a navigation bar which stays whatever the page you're on (error pages included), see an examples/extend-app/ for more details and documentation (you can also watch the short video example)context.isDev
in the data(context) and fetch(context) methods, can be useful for caching some data calls on productioncallback
argument (optional), in data(context [, callback])
method, because not everyone may be comfortable with using Promises. The callback is the node.js style: callback(err, data)
, see examples/async-data/ for more details.callback
.Published by Atinux almost 8 years ago
Content-Type
: text/html; charset=utf-8
headerPublished by alexchopin almost 8 years ago
Published by Atinux almost 8 years ago
Published by Atinux almost 8 years ago
mixins
or export default Vue.extend({ ... })
inside the pagesSide note, when exporting a page with Vue.extend
, the hot-reloading might have some difficulties to works perfectly.
Published by Atinux almost 8 years ago
query
of babel-loader via build.babel
option in nuxt.config.js
.Defaults are:
{
presets: [
['es2015', { modules: false }],
'stage-2'
],
cacheDirectory: false // true if launched via nuxt-dev
}
Published by Atinux almost 8 years ago
The store
option has been removed in the nuxt.config.js
file, it's now implicit.
If a store/index.js
file is detected, the store option will be activated and Vuex will be imported, see examples/vuex-store/ for more details.
Published by Atinux almost 8 years ago
build.plugins
option in nuxt.config.js
file to add custom plugin for webpackPublished by Atinux almost 8 years ago
nuxtServerInit
action in the store if defined, let you handle some use-cases with authenticated users for example (see https://github.com/nuxt/nuxt.js/tree/master/examples/vuex-store#action-nuxtserverinit)Published by Atinux almost 8 years ago
context.error
method to show the error page from the data
or fetch
method inside the pages, see example/custom-routes/
_Ctor
#6Published by Atinux almost 8 years ago
nuxt.config.js
when using nuxt-dev
to reload the build when updating the config filePublished by Atinux almost 8 years ago
Published by Atinux almost 8 years ago
Published by Atinux almost 8 years ago
head
field in components and nuxt.config.js
, see examples/head-elements
~static
in webpack for assets -> <img src="~static/nuxt.png" />
Published by Atinux almost 8 years ago
del
dependencies, using fs-extra
remove
insteadmkdirp-then
dependencies, using fs-extra
mkdirp
insteadPublished by Atinux almost 8 years ago
redirect
api, it's now: redirect([code,] path [, query])
, the default status code is 302
Foundexport default {
data ({ redirect, route }) {
// Check if user is connected via req.session or JWT...
redirect('/login', { redirect: route.fullPath })
}
}