小编ami*_*aro的帖子

Heroku 使用 Github 部署方法解决 GitHub 令牌问题

为什么我在 Heroku 上使用 Github 部署的应用程序会收到此错误消息?

此应用程序的 GitHub 令牌存在问题。断开并重新连接以恢复功能

Github 令牌问题

deployment github heroku

7
推荐指数
1
解决办法
1361
查看次数

重定向路线并显示消息

我想知道是否有一种方法可以重定向路由或返回Response带有数据的 a 并使用该函数在另一个页面上获取它loader

基本上,我试图使用表单创建一个新对象,并重定向到另一个我想要显示创建成功消息的页面。

这是一个表单页面示例:

我正在尝试在正文中发送消息Response

import { ActionFunction, Form } from "remix";

export const action: ActionFunction = async ({ request }) => {
  // const formData = await request.formData();

  return new Response(JSON.stringify({ message: "Hello world!" }), {
    status: 303,
    headers: {
      Location: "/new-page",
    },
  });
};

export default function Index() {
  return (
    <div>
      <Form method="post">
        <input type="text" id="name" name="name" />
        <button type="submit">Submit</button>
      </Form>
    </div>
  );
}
Run Code Online (Sandbox Code Playgroud)

此时NewPage我需要知道是否有办法获取重定向响应上的消息。

import { ActionFunction …
Run Code Online (Sandbox Code Playgroud)

remix.run

6
推荐指数
1
解决办法
7724
查看次数

在另一个计算属性上调用 getter 不是测试中的函数

我一直在尝试模拟 getter 函数,但该函数也被另一个计算属性调用,并且它作为未定义函数返回。

这是一个面包屑组件,会根据路由路径而变化。第一个测试正常通过,因为该组件不应该渲染。但第二个测试尝试使用用户名通过 getter 获取用户数据。

我的疑问是关于模拟吸气剂。它不是应该返回 beforeEach 定义的模拟对象吗?

提前致谢!

这是测试规范:

import {
  shallowMount,
  createLocalVue
} from '@vue/test-utils'
import Breadcrumb from '@/components/Breadcrumb.vue'
import Vuex from 'vuex'
import VueRouter from 'vue-router'

const localVue = createLocalVue()

localVue.use(Vuex)
localVue.use(VueRouter)
const router = new VueRouter()

describe('Breadcrumb.vue', () => {
  let store

  beforeEach(() => {
    store = new Vuex.Store({
      getters: {
        getUserByUsername: (path) => ({
          name: {
            first: 'FirstName',
            last: 'LastName'
          }
        })
      }
    })
  })

  it('renders home page breadcrumb', () => {
    const wrapper …
Run Code Online (Sandbox Code Playgroud)

vue.js jestjs vuex

1
推荐指数
1
解决办法
1610
查看次数

标签 统计

deployment ×1

github ×1

heroku ×1

jestjs ×1

remix.run ×1

vue.js ×1

vuex ×1