Node.js/nuxt/asyncData/asyncdata详细内容:修订间差异

来自康健生活
Kangkk​(留言 | 贡献)
Kangkk​(留言 | 贡献)
 
第791行: 第791行:
}</syntaxhighlight>
}</syntaxhighlight>
== app ==
== app ==
<syntaxhighlight lang="javascript">
<ref *3> {
  head: {
    title: 'askgo',
    meta: [
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object]
    ],
    script: [ [Object] ],
    __dangerouslyDisableSanitizers: [ 'script', 'style' ],
    link: [ [Object] ],
    style: [ [Object] ]
  },
  store: Store {
    _committing: false,
    _actions: [Object: null prototype] {
      nuxtServerInit: [Array],
      'cookies/setUser': [Array],
      'file/initFile': [Array],
      'file/setFile': [Array],
      'file/getFile': [Array],
      'file/deleteFile': [Array],
      'file/updateFileList': [Array],
      'file/updatePhotoList': [Array],
      'file/addFile': [Array],
      'file/addPhoto': [Array],
      'pagination/initPagination': [Array],
      'pagination/setPagination': [Array],
      'pagination/getPagination': [Array],
      'user/setToken': [Array],
      'user/setUserInfo': [Array],
      'user/deleteToken': [Array]
    },
    _actionSubscribers: [],
    _mutations: [Object: null prototype] {
      'cookies/updateUser': [Array],
      'cookies/deleteUser': [Array],
      'cookies/deleteAll': [Array],
      'file/initFile': [Array],
      'file/updateFile': [Array],
      'file/addFile': [Array],
      'file/addPhoto': [Array],
      'file/deleteFile': [Array],
      'file/getFile': [Array],
      'pagination/initPagination': [Array],
      'pagination/updatePagination': [Array],
      'pagination/getPagination': [Array],
      'user/updateToken': [Array],
      'user/updateUserInfo': [Array],
      'user/deleteToken': [Array]
    },
    _wrappedGetters: [Object: null prototype] {
      user: [Function: wrappedGetter],
      userId: [Function: wrappedGetter]
    },
    _modules: ModuleCollection { root: [Module] },
    _modulesNamespaceMap: [Object: null prototype] {
      'cookies/': [Module],
      'file/': [Module],
      'pagination/': [Module],
      'session/': [Module],
      'user/': [Module]
    },
    _subscribers: [],
    _watcherVM: <ref *1> Vue {
      _uid: 9613,
      _isVue: true,
      '$options': [Object],
      _renderProxy: [Circular *1],
      _self: [Circular *1],
      '$parent': undefined,
      '$root': [Circular *1],
      '$children': [],
      '$refs': {},
      _watcher: null,
      _inactive: null,
      _directInactive: false,
      _isMounted: false,
      _isDestroyed: false,
      _isBeingDestroyed: false,
      _events: [Object: null prototype],
      _hasHookEvent: true,
      _vnode: null,
      _staticTrees: null,
      '$vnode': undefined,
      '$slots': {},
      '$scopedSlots': {},
      _c: [Function (anonymous)],
      '$createElement': [Function (anonymous)],
      '$attrs': [Getter/Setter],
      '$listeners': [Getter/Setter],
      _routerRoot: [Circular *1],
      _watchers: [],
      '$seo': [Function: bound $seo],
      _data: {}
    },
    _makeLocalGettersCache: [Object: null prototype] { 'user/': {} },
    dispatch: [Function: boundDispatch],
    commit: [Function: boundCommit],
    strict: true,
    getters: { user: [Getter], userId: [Getter] },
    _vm: <ref *2> Vue {
      _uid: 9614,
      _isVue: true,
      '$options': [Object],
      _renderProxy: [Circular *2],
      _self: [Circular *2],
      '$parent': undefined,
      '$root': [Circular *2],
      '$children': [],
      '$refs': {},
      _watcher: null,
      _inactive: null,
      _directInactive: false,
      _isMounted: false,
      _isDestroyed: false,
      _isBeingDestroyed: false,
      _events: [Object: null prototype],
      _hasHookEvent: true,
      _vnode: null,
      _staticTrees: null,
      '$vnode': undefined,
      '$slots': {},
      '$scopedSlots': {},
      _c: [Function (anonymous)],
      '$createElement': [Function (anonymous)],
      '$attrs': [Getter/Setter],
      '$listeners': [Getter/Setter],
      _routerRoot: [Circular *2],
      _watchers: [Array],
      '$seo': [Function: bound $seo],
      _data: [Object],
      _computedWatchers: [Object: null prototype] {},
      user: [Getter/Setter],
      userId: [Getter/Setter]
    },
    '$router': VueRouter {
      app: [Vue],
      apps: [Array],
      options: [Object],
      beforeHooks: [],
      resolveHooks: [],
      afterHooks: [],
      matcher: [Object],
      fallback: true,
      mode: 'abstract',
      history: [AbstractHistory]
    },
    registerModule: [Function (anonymous)],
    app: [Circular *3],
    '$config': {},
    '$cookies': {
      parseJSON: true,
      set: [Function: set],
      setAll: [Function: setAll],
      get: [Function: get],
      getAll: [Function: getAll],
      remove: [Function: remove],
      removeAll: [Function: removeAll],
      nodeCookie: [Object]
    },
    '$axios': [Function: wrap] {
      request: [Function: wrap],
      getUri: [Function: wrap],
      delete: [Function: wrap],
      get: [Function: wrap],
      head: [Function: wrap],
      options: [Function: wrap],
      post: [Function: wrap],
      put: [Function: wrap],
      patch: [Function: wrap],
      defaults: [Object],
      interceptors: [Object],
      CancelToken: [Function],
      isCancel: [Function: isCancel],
      setBaseURL: [Function: bound setBaseURL],
      setHeader: [Function: bound setHeader],
      setToken: [Function: bound setToken],
      onRequest: [Function: bound onRequest],
      onResponse: [Function: bound onResponse],
      onRequestError: [Function: bound onRequestError],
      onResponseError: [Function: bound onResponseError],
      onError: [Function: bound onError],
      create: [Function: bound create],
      '$request': [Function: bound ],
      '$delete': [Function: bound ],
      '$get': [Function: bound ],
      '$head': [Function: bound ],
      '$options': [Function: bound ],
      '$post': [Function: bound ],
      '$put': [Function: bound ],
      '$patch': [Function: bound ]
    }
  },
  router: <ref *5> VueRouter {
    app: <ref *4> Vue {
      _uid: 9615,
      _isVue: true,
      '$options': [Object],
      _renderProxy: [Circular *4],
      _self: [Circular *4],
      '$parent': undefined,
      '$root': [Circular *4],
      '$children': [],
      '$refs': {},
      _watcher: null,
      _inactive: null,
      _directInactive: false,
      _isMounted: false,
      _isDestroyed: false,
      _isBeingDestroyed: false,
      _events: [Object: null prototype],
      _hasHookEvent: true,
      _vnode: null,
      _staticTrees: null,
      '$vnode': undefined,
      '$slots': {},
      '$scopedSlots': {},
      _c: [Function (anonymous)],
      '$createElement': [Function (anonymous)],
      '$attrs': [Getter/Setter],
      '$listeners': [Getter/Setter],
      _routerRoot: [Circular *4],
      _router: [Circular *5],
      _route: [Getter/Setter],
      '$store': [Store],
      _vueMeta: [Object],
      nuxt: [Getter/Setter],
      _watchers: [Array],
      '$seo': [Function: bound $seo],
      refreshOnlineStatus: [Function: bound refreshOnlineStatus],
      refresh: [Function: bound refresh] AsyncFunction,
      errorChanged: [Function: bound errorChanged],
      setLayout: [Function: bound setLayout],
      loadLayout: [Function: bound loadLayout],
      _data: [Object],
      nbFetching: [Getter/Setter],
      layoutName: [Getter/Setter],
      layout: [Getter/Setter],
      isOnline: [Getter/Setter],
      _computedWatchers: [Object: null prototype] {},
      isOffline: [Getter/Setter],
      isFetching: [Getter/Setter],
      error: [Function: error],
      context: [Object]
    },
    apps: [ [Vue] ],
    options: { mode: 'history', routes: [Array] },
    beforeHooks: [],
    resolveHooks: [],
    afterHooks: [],
    matcher: { match: [Function: match], addRoutes: [Function: addRoutes] },
    fallback: true,
    mode: 'abstract',
    history: AbstractHistory {
      router: [Circular *5],
      base: '',
      current: [Object],
      pending: null,
      ready: true,
      readyCbs: [],
      readyErrorCbs: [],
      errorCbs: [],
      listeners: [],
      stack: [Array],
      index: 0,
      cb: [Function (anonymous)]
    }
  },
  nuxt: {
    defaultTransition: {
      name: 'page',
      mode: 'out-in',
      appear: false,
      appearClass: 'appear',
      appearActiveClass: 'appear-active',
      appearToClass: 'appear-to'
    },
    transitions: [ [Object] ],
    setTransitions: [Function: setTransitions],
    err: null,
    dateErr: null,
    error: [Function: error]
  },
  render: [Function: render],
  data: [Function: data],
  beforeCreate: [Function: beforeCreate],
  created: [Function: created],
  mounted: [AsyncFunction: mounted],
  watch: { 'nuxt.err': 'errorChanged' },
  computed: {
    isOffline: [Function: isOffline],
    isFetching: [Function: isFetching]
  },
  methods: {
    refreshOnlineStatus: [Function: refreshOnlineStatus],
    refresh: [AsyncFunction: refresh],
    errorChanged: [Function: errorChanged],
    setLayout: [Function: setLayout],
    loadLayout: [Function: loadLayout]
  },
  components: {
    NuxtLoading: {
      data: [Function: data],
      computed: [Object],
      beforeDestroy: [Function: beforeDestroy],
      methods: [Object],
      render: [Function],
      staticRenderFns: [],
      _compiled: true,
      _scopeId: 'data-v-e4fb9492',
      _ssrRegister: [Function: hook],
      beforeCreate: [Array],
      __file: 'components/simple/router-loading/loading.vue'
    }
  },
  context: {
    isStatic: false,
    isDev: true,
    isHMR: false,
    app: [Circular *3],
    store: Store {
      _committing: false,
      _actions: [Object: null prototype],
      _actionSubscribers: [],
      _mutations: [Object: null prototype],
      _wrappedGetters: [Object: null prototype],
      _modules: [ModuleCollection],
      _modulesNamespaceMap: [Object: null prototype],
      _subscribers: [],
      _watcherVM: [Vue],
      _makeLocalGettersCache: [Object: null prototype],
      dispatch: [Function: boundDispatch],
      commit: [Function: boundCommit],
      strict: true,
      getters: [Object],
      _vm: [Vue],
      '$router': [VueRouter],
      registerModule: [Function (anonymous)],
      app: [Circular *3],
      '$config': {},
      '$cookies': [Object],
      '$axios': [Function]
    },
    payload: undefined,
    error: [Function: bound error],
    base: '/',
    env: { host: [Object], target: 'development', SECRET: 'kangkk' },
    req: IncomingMessage {
      _readableState: [ReadableState],
      _events: [Object: null prototype] {},
      _eventsCount: 0,
      _maxListeners: undefined,
      socket: [Socket],
      httpVersionMajor: 1,
      httpVersionMinor: 0,
      httpVersion: '1.0',
      complete: true,
      headers: [Object],
      rawHeaders: [Array],
      trailers: {},
      rawTrailers: [],
      aborted: false,
      upgrade: false,
      url: '/user/follow',
      method: 'GET',
      statusCode: null,
      statusMessage: null,
      client: [Socket],
      _consuming: false,
      _dumped: false,
      originalUrl: '/user/follow',
      _parsedUrl: [Url],
      _parsedOriginalUrl: [Url],
      [Symbol(kCapture)]: false
    },
    res: ServerResponse {
      _events: [Object: null prototype],
      _eventsCount: 1,
      _maxListeners: undefined,
      outputData: [],
      outputSize: 0,
      writable: true,
      destroyed: false,
      _last: false,
      chunkedEncoding: false,
      shouldKeepAlive: false,
      useChunkedEncodingByDefault: false,
      sendDate: true,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      _contentLength: null,
      _hasBody: true,
      _trailer: '',
      finished: false,
      _headerSent: false,
      socket: [Socket],
      _header: null,
      _onPendingData: [Function: bound updateOutgoingData],
      _sent100: false,
      _expect_continue: false,
      timing: [ServerTiming],
      writeHead: [Function: writeHead],
      locals: {},
      statusCode: 200,
      [Symbol(kCapture)]: false,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
      [Symbol(kOutHeaders)]: null
    },
    ssrContext: {
      req: [IncomingMessage],
      res: [ServerResponse],
      url: '/user/follow',
      target: 'server',
      spa: undefined,
      modern: false,
      runtimeConfig: [Object],
      _registeredComponents: Set(0) {},
      styles: [Getter],
      _renderStyles: [Function: renderStyles],
      _styles: [Object],
      redirected: false,
      next: [Function (anonymous)],
      beforeRenderFns: [],
      nuxt: [Object],
      meta: [Object],
      asyncData: {}
    },
    redirect: [Function (anonymous)],
    beforeNuxtRender: [Function (anonymous)],
    route: {
      name: 'follow',
      meta: [Array],
      path: '/user/follow',
      hash: '',
      query: {},
      params: [Object],
      fullPath: '/user/follow',
      matched: [Array]
    },
    next: [Function (anonymous)],
    _redirected: false,
    _errored: false,
    params: { id: undefined },
    query: {},
    '$config': {},
    '$cookies': {
      parseJSON: true,
      set: [Function: set],
      setAll: [Function: setAll],
      get: [Function: get],
      getAll: [Function: getAll],
      remove: [Function: remove],
      removeAll: [Function: removeAll],
      nodeCookie: [Object]
    },
    '$axios': [Function: wrap] {
      request: [Function: wrap],
      getUri: [Function: wrap],
      delete: [Function: wrap],
      get: [Function: wrap],
      head: [Function: wrap],
      options: [Function: wrap],
      post: [Function: wrap],
      put: [Function: wrap],
      patch: [Function: wrap],
      defaults: [Object],
      interceptors: [Object],
      CancelToken: [Function],
      isCancel: [Function: isCancel],
      setBaseURL: [Function: bound setBaseURL],
      setHeader: [Function: bound setHeader],
      setToken: [Function: bound setToken],
      onRequest: [Function: bound onRequest],
      onResponse: [Function: bound onResponse],
      onRequestError: [Function: bound onRequestError],
      onResponseError: [Function: bound onResponseError],
      onError: [Function: bound onError],
      create: [Function: bound create],
      '$request': [Function: bound ],
      '$delete': [Function: bound ],
      '$get': [Function: bound ],
      '$head': [Function: bound ],
      '$options': [Function: bound ],
      '$post': [Function: bound ],
      '$put': [Function: bound ],
      '$patch': [Function: bound ]
    },
    '$errorHandler': [Function (anonymous)]
  },
  '$config': {},
  '$cookies': {
    parseJSON: true,
    set: [Function: set],
    setAll: [Function: setAll],
    get: [Function: get],
    getAll: [Function: getAll],
    remove: [Function: remove],
    removeAll: [Function: removeAll],
    nodeCookie: { parse: [Function: o], serialize: [Function: n] }
  },
  '$axios': [Function: wrap] {
    request: [Function: wrap],
    getUri: [Function: wrap],
    delete: [Function: wrap],
    get: [Function: wrap],
    head: [Function: wrap],
    options: [Function: wrap],
    post: [Function: wrap],
    put: [Function: wrap],
    patch: [Function: wrap],
    defaults: {
      headers: [Object],
      baseURL: 'http://localhost:3000/',
      transformRequest: [Array],
      transformResponse: [Array],
      timeout: 3000,
      adapter: [Function: httpAdapter],
      xsrfCookieName: 'XSRF-TOKEN',
      xsrfHeaderName: 'X-XSRF-TOKEN',
      maxContentLength: -1,
      maxBodyLength: -1,
      validateStatus: [Function: validateStatus],
      retry: 3,
      retryDelay: 2000
    },
    interceptors: { request: [InterceptorManager], response: [InterceptorManager] },
    CancelToken: [Function: CancelToken] { source: [Function: source] },
    isCancel: [Function: isCancel],
    setBaseURL: [Function: bound setBaseURL],
    setHeader: [Function: bound setHeader],
    setToken: [Function: bound setToken],
    onRequest: [Function: bound onRequest],
    onResponse: [Function: bound onResponse],
    onRequestError: [Function: bound onRequestError],
    onResponseError: [Function: bound onResponseError],
    onError: [Function: bound onError],
    create: [Function: bound create],
    '$request': [Function: bound ],
    '$delete': [Function: bound ],
    '$get': [Function: bound ],
    '$head': [Function: bound ],
    '$options': [Function: bound ],
    '$post': [Function: bound ],
    '$put': [Function: bound ],
    '$patch': [Function: bound ]
  }
}</syntaxhighlight>
== other ==
== other ==