【发布时间】:2022-01-24 03:42:10
【问题描述】:
我正在尝试实现一种功能切换以与我的组件一起使用。我想知道是否可以通过使用 {{ }} 评估它来将数据传递给组件:
The current UNIX timestamp is {{ time() }}.
这是我的代码: 组件
<x-share-on-social-media :isOn="{{FeatureToggleUtility::isOn('share-on-social-media')}}"/>
组件类
class ShareOnSocialMedia extends Component {
public $isOn;
/**
* Create a new component instance.
*
* @return void
*/
public function __construct($isOn) {
$this->isOn = $isOn;
}
....
}
我收到以下错误:
ParseError
syntax error, unexpected token "<" (View: /....../resources/views/offer.blade.php)
http://localhost:8899/offer/30
【问题讨论】:
-
添加你的
/resources/views/offer.blade.php的代码
标签: laravel laravel-blade