热门面试题与答案和在线测试
面向面试准备、在线测试、教程与实战练习的学习平台

通过聚焦学习路径、模拟测试和面试实战内容持续提升技能。

WithoutBook 将分主题面试题、在线练习测试、教程和对比指南整合到一个响应式学习空间中。

面试准备

模拟考试

设为首页

收藏此页面

订阅邮箱地址

Svelte.js 面试题与答案

问题 16. How can you conditionally apply CSS classes in Svelte?

You can conditionally apply CSS classes in Svelte using the 'class:' directive. For example: {class: active ? 'active' : 'inactive'}

这有帮助吗? 添加评论 查看评论
 

问题 17. What is the purpose of the 'context' API in Svelte?

The 'context' API in Svelte allows components to communicate indirectly by sharing state with their descendants. It's useful for avoiding prop drilling.

这有帮助吗? 添加评论 查看评论
 

问题 18. How can you handle form submissions in Svelte?

Form submissions in Svelte can be handled using the 'on:submit' directive. You can prevent the default form behavior and implement your custom logic in the associated function.

这有帮助吗? 添加评论 查看评论
 

问题 19. What is the purpose of the 'use:' directive in Svelte?

The 'use:' directive in Svelte is used to apply actions to DOM elements. Actions are functions that can perform side effects, like animating or interacting with the DOM.

这有帮助吗? 添加评论 查看评论
 

问题 20. Explain the difference between reactive declarations and statements in Svelte.

Reactive declarations in Svelte create reactive variables based on dependencies, while reactive statements directly execute code when dependencies change. Declarations use '$:' syntax, and statements use '{# ... }'.

这有帮助吗? 添加评论 查看评论
 

用户评价最有帮助的内容:

版权所有 © 2026,WithoutBook。