有没有办法来动态改变ArgTypes时,args在一个童话成分的变化?
例如,假设一个故事的组件有 2 个控件:id和value。
id可以是1或2。如果id == '1'那样argTypes.value.control.min = 0,否则argTypes.value.control.min = -100。
示例代码:
export default {
argTypes: {
id: { control: { type: 'select', options: ['1', '2']}},
value: { control: {type: 'range', min:0, max: 100, step:10}},
}
};
const Template = (args) => <MyComponent {...args} />;
export const Example = Template.bind({});
Template.args = {
id: '1',
value: 0,
};
Run Code Online (Sandbox Code Playgroud) 库需要将二进制数据作为void *. \n要共享的数据以shared_ptr<T>.
有没有办法投射shared_ptr<T>到void *?
PS:静态投射不起作用:
\n\nerror: invalid static_cast from type \xe2\x80\x98std::shared_ptr<DataPacket>\xe2\x80\x99 to type \xe2\x80\x98void*\xe2\x80\x99\n static_cast<void *>(binData);\n