本文介绍了Livewire不渲染的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道自己缺少什么,但是我遵循了每个步骤,但是并没有重新呈现视图.

I do not know what I am missing but I followed every step but it does not rerender the view.

这是我的livewire组件类:

Here's my livewire component class:

use Livewire\Component;

class HelloWorld extends Component
{
    public $message = 'Hello, world!';

    public function render()
    {
        return view('livewire.hello-world');
    }
}

这是实时线视图:

<input type="text" wire:model="message">{{ $message }}

当我在输入框中键入内容时,我看到正在发送XHR请求,但视图没有更新.我在这里想念什么?我已经寻找了几个小时的答案.

When I type in the input box, I see XHR requests being sent but the view does not update. What am I missing here? I have been looking around for answers for few hours already.

推荐答案

来自Livewire的文档:

From Livewire's docs:

将其放入div应该可以解决此问题.

Putting it in a div should fix this issue.

这篇关于Livewire不渲染的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-07 18:23